Koha-clms/t/Koha
David Cook 0048be7498 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>
(cherry picked from commit 629d2a6f6c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2024-12-18 10:54:10 +01:00
..
Auth Bug 30230: (follow-up) fix unit test 2024-02-01 16:22:55 +01:00
Authority Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Database Bug 29695: Add new module Koha::Database::Columns 2022-04-12 11:40:16 +02:00
DateTime/Format Bug 36486: Fix file perms and tidiness 2024-05-29 11:00:13 +02:00
I18N/po/xx_XX/LC_MESSAGES Bug 29695: Add new module Koha::Database::Columns 2022-04-12 11:40:16 +02:00
Middleware Bug 33967: Add unit test to ensure SetEnv doesn't compromise $env 2023-06-09 08:50:13 -03:00
Object Bug 29857: (follow-up) Fix t/Koha/Object/Message.t 2022-03-02 09:40:05 -10:00
Plugins Bug 22223: Add filter to make item URLs safe in template output 2024-12-18 10:54:10 +01:00
REST/Plugin Bug 37018: Unit tests 2024-07-25 09:58:11 +02:00
Result Bug 29746: (it-doesn't-hurt follow-up) More tests 2022-01-05 13:33:46 -10:00
SearchEngine Bug 32707: Unit tests 2024-05-23 14:05:51 +02:00
Util Bug 30678: (follow-up) Add oclc_number routine and friends 2022-07-22 14:58:11 -03:00
Config.t Bug 31393: Tidy 2023-10-30 09:02:18 -03:00
Email.t Bug 29857: (follow-up) Fix t/Koha/Email.t 2022-03-02 09:40:05 -10:00
Exceptions.t Bug 35248: Add test for Koha::Exceptions::Booking 2024-03-19 09:00:57 +01:00
I18N.t Bug 15395: Allow correct handling of plural translation 2018-11-08 15:55:50 +00:00
ItemType.t Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Script.t Bug 24786: Fix Script_cron.t and t/Koha/Script.t 2020-11-06 17:04:31 +01:00
Script_cron.t Bug 24786: Fix Script_cron.t and t/Koha/Script.t 2020-11-06 17:04:31 +01:00
Z3950responder.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
sleep.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
wait.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00