summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-06-30 21:13:41 -0400
committerJoey Hess <joey@kodama.kitenet.net>2008-06-30 21:13:41 -0400
commitdbab5e9b85b04c5ae5b8687b954ff0ae96f1c3f4 (patch)
tree15b50385599591387c6ed2220d7f30f078a4ffbb
parente1d9747be167c834c5b1b98331f40dc98fc46c93 (diff)
disable cgi uploads earlier
This allows plugins that want to enable uploads to do so by changing the value of $CGI::DISABLE_UPLOADS at some point before the cgi hook is run.
-rw-r--r--IkiWiki/CGI.pm6
1 files changed, 2 insertions, 4 deletions
diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm
index 2c4590bab..0d010b115 100644
--- a/IkiWiki/CGI.pm
+++ b/IkiWiki/CGI.pm
@@ -6,6 +6,8 @@ use IkiWiki;
use IkiWiki::UserInfo;
use open qw{:utf8 :std};
use Encode;
+use CGI;
+$CGI::DISABLE_UPLOADS=1;
package IkiWiki;
@@ -666,10 +668,6 @@ sub cgi (;$$) { #{{{
my $q=shift;
my $session=shift;
- eval q{use CGI};
- error($@) if $@;
- $CGI::DISABLE_UPLOADS=1;
-
if (! $q) {
binmode(STDIN);
$q=CGI->new;