X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/dbab5e9b85b04c5ae5b8687b954ff0ae96f1c3f4..c987aee47acfcc0df4c1ac2667d9c63133e99d2b:/IkiWiki/CGI.pm?ds=inline diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index 0d010b115..07e92322f 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -6,8 +6,6 @@ use IkiWiki; use IkiWiki::UserInfo; use open qw{:utf8 :std}; use Encode; -use CGI; -$CGI::DISABLE_UPLOADS=1; package IkiWiki; @@ -305,7 +303,7 @@ sub cgi_editpage ($$) { #{{{ # This untaint is safe because titlepage removes any problematic # characters. - my ($page)=$form->field('page'); + my $page=$form->field('page'); $page=titlepage(possibly_foolish_untaint($page)); if (! defined $page || ! length $page || file_pruned($page, $config{srcdir}) || $page=~/^\//) { @@ -668,6 +666,10 @@ sub cgi (;$$) { #{{{ my $q=shift; my $session=shift; + eval q{use CGI}; + error($@) if $@; + $CGI::DISABLE_UPLOADS=$config{cgi_disable_uploads}; + if (! $q) { binmode(STDIN); $q=CGI->new;