]> git.koha-community.org Git - koha.git/commit
Bug 36875: Do not pass unsanitized language to $page->translated_content
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Thu, 16 May 2024 07:19:30 +0000 (07:19 +0000)
committerKatrin Fischer <katrin.fischer@bsz-bw.de>
Thu, 20 Jun 2024 15:55:37 +0000 (17:55 +0200)
commit4c3a6c39100947eda290f3f61d0be0733322843c
tree56243e49b38bc74b287039cd1aee4e90c8f630b9
parentda7186ea3d79f0edd9b65a11857d3cf485056370
Bug 36875: Do not pass unsanitized language to $page->translated_content

Test plan:
Try to access opac-page.pl with a language not in OPACLanguages.
Verify that this 'language' was not passed to sql. Simplest perhaps
by debugging AdditionalContent.pm. Something like:
 sub translated_content {
     my ( $self, $lang ) = @_;
+warn "L137: $lang";
Now have a public additional_contents page and hit it:
    /cgi-bin/koha/opac-page.pl?page_id=5&language=badsql
Check your log and find:
[2024/05/16 07:25:53] [WARN] L137: en at [etc] line 137.
So badsql was caught.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
opac/opac-page.pl