aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/CGI.pm
diff options
context:
space:
mode:
authorAmitai Schlair <schmonz-web-ikiwiki@schmonz.com>2014-10-15 22:32:02 +0100
committerSimon McVittie <smcv@debian.org>2014-10-16 22:24:47 +0100
commitcfbcbda0ad848334640ad849ed618873ecba8eb4 (patch)
treef69b27dcfec192eb881cd8741dcb1dc92b955440 /IkiWiki/CGI.pm
parentf4ec7b06d97c8406c5f5be7332ead2f28c271371 (diff)
downloadikiwiki-cfbcbda0ad848334640ad849ed618873ecba8eb4.tar
ikiwiki-cfbcbda0ad848334640ad849ed618873ecba8eb4.tar.gz
Call CGI->param_fetch instead of CGI->param in array context
CGI->param has the misfeature that it is context-sensitive, and in particular can expand to more than one scalar in function calls. This led to a security vulnerability in Bugzilla, and recent versions of CGI.pm will warn when it is used in this way. In the situations where we do want to cope with more than one parameter of the same name, CGI->param_fetch (which always returns an array-reference) makes the intention clearer. [commit message added by smcv]
Diffstat (limited to 'IkiWiki/CGI.pm')
-rw-r--r--IkiWiki/CGI.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm
index 0224c2aac..f448db6ef 100644
--- a/IkiWiki/CGI.pm
+++ b/IkiWiki/CGI.pm
@@ -122,7 +122,8 @@ sub decode_cgi_utf8 ($) {
if ($] < 5.01) {
my $cgi = shift;
foreach my $f ($cgi->param) {
- $cgi->param($f, map { decode_utf8 $_ } $cgi->param($f));
+ $cgi->param($f, map { decode_utf8 $_ }
+ @{$cgi->param_fetch($f)});
}
}
}