Koha-clms/t/Koha
David Cook 629d2a6f6c Bug 22223: Add filter to make item URLs safe in template output
This change adds a "safe_url" filter which takes a text input and
returns a Perl URL object which stringifies to a safe URL.

This change is only needed in the OPAC as the staff interface
handles the item URL display using Javascript not Template Toolkit.

0. Apply patch and koha-plack --restart kohadev
1. Create an item for a record using the following URL
https://koha-community.org?url=https%3A%2F%2Fkoha-community.org
2. Go to the OPAC for that record and verify that the URL is
not double-escaped
3. Create a malicious payload (talk to QA/security team for this if necessary)
4. Note that the malicious payload is escaped
5. prove t/Koha/Plugins/SafeURL.t
6. Celebrate!

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e8e00cfeb3)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-12-05 21:38:46 +00:00
..
Auth Bug 29393: (QA follow-up) Add key to Permissions test 2024-05-01 07:31:26 +01:00
Authority
…
Database
…
DateTime/Format Bug 36486: Fix file perms and tidiness 2024-05-10 16:45:49 +02:00
I18N/po/xx_XX/LC_MESSAGES
…
Installer Bug 35681: Add Koha::Installer::Output 2024-05-02 16:47:40 +02:00
Middleware Bug 33967: Add unit test to ensure SetEnv doesn't compromise $env 2023-06-09 08:50:13 -03:00
Object
…
Plugins Bug 22223: Add filter to make item URLs safe in template output 2024-12-05 21:38:46 +00:00
REST/Plugin Bug 37389: Add tests 2024-08-29 17:42:21 +00:00
Result
…
SearchEngine Bug 31652: Add geo-search 2024-04-29 15:19:34 +02:00
Util
…
Config.t Bug 31393: Tidy 2023-10-30 09:02:18 -03:00
Email.t Bug 31627: (follow-up) Update -Id to -ID 2024-05-10 14:11:50 +02:00
Exceptions.t Bug 35248: Add test for Koha::Exceptions::Booking 2024-03-15 09:38:46 +01:00
I18N.t
…
ItemType.t
…
Script.t
…
Script_cron.t
…
Z3950responder.t
…
sleep.pl
…
wait.pl
…