Koha-clms/Koha/Template/Plugin
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
..
AdditionalContents.pm Bug 37628: (follow-up) Remove get_opac_news_by_id 2024-11-18 18:50:24 +00:00
Asset.pm
…
AudioAlerts.pm
…
AuthClient.pm
…
AuthorisedValues.pm Bug 33568: Status 2024-04-05 15:34:48 +02:00
Biblio.pm Bug 35790: Remove Koha::Template::Plugin::Biblio::CanArticleRequest 2024-03-22 12:26:45 +01:00
Branches.pm
…
Categories.pm
…
CirculationRules.pm
…
ClassSources.pm
…
Context.pm
…
Desks.pm
…
ExtendedAttributeTypes.pm Bug 34519: (follow-up) fix QA tool complaints 2023-11-08 17:52:39 -03:00
Frameworks.pm
…
HtmlId.pm
…
HtmlTags.pm
…
I18N.pm
…
ItemTypes.pm
…
JSConsents.pm
…
Koha.pm Bug 36700: Fix underscore in CSRF header 2024-05-01 13:40:12 +01:00
KohaDates.pm
…
KohaPlugins.pm
…
KohaSpan.pm
…
Languages.pm
…
NoticeTemplates.pm Bug 29393: Prevent SQL errors when SQL strict mode is set 2024-04-29 17:38:00 +02:00
Notices.pm Bug 32986: (follow-up) Fix CircAutoPrintQuickSlip and remove unecessary module usage 2023-11-08 17:59:35 -03:00
Price.pm
…
Registers.pm
…
Remove_MARC_punctuation.pm
…
SafeURL.pm Bug 22223: Add filter to make item URLs safe in template output 2024-12-05 21:38:46 +00:00
TablesSettings.pm Bug 34913: DataTables upgrade: Update CSS and option names 2024-01-26 15:13:40 +01:00
To.pm
…
raw.pm
…