X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/c915ff6953f508454000767ad4ca3d0a0428b5bf..bb3036317d6e4102545506f200e594cc67d7589b:/IkiWiki.pm diff --git a/IkiWiki.pm b/IkiWiki.pm index 7d5668d74..03b4b666e 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -88,6 +88,7 @@ sub defaultconfig () { #{{{ account_creation_password => "", prefix_directives => 0, hardlink => 0, + cgi_disable_uploads => 1, } #}}} sub checkconfig () { #{{{ @@ -1289,6 +1290,13 @@ sub pagespec_valid ($) { #{{{ my $sub=pagespec_translate($spec); return ! $@; } #}}} + +sub glob2re ($) { #{{{ + my $re=quotemeta(shift); + $re=~s/\\\*/.*/g; + $re=~s/\\\?/./g; + return $re; +} #}}} package IkiWiki::FailReason; @@ -1336,12 +1344,8 @@ sub match_glob ($$;@) { #{{{ $glob="$from/$glob" if length $from; } - # turn glob into safe regexp - $glob=quotemeta($glob); - $glob=~s/\\\*/.*/g; - $glob=~s/\\\?/./g; - - if ($page=~/^$glob$/i) { + my $regexp=IkiWiki::glob2re($glob); + if ($page=~/^$regexp$/i) { if (! IkiWiki::isinternal($page) || $params{internal}) { return IkiWiki::SuccessReason->new("$glob matches $page"); }