X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/788105e2a73a3be0f9a05a390702ee28318a5673..b3bca318ef11ce9d0609d952a72849243b591b9d:/IkiWiki.pm diff --git a/IkiWiki.pm b/IkiWiki.pm index bb7d46ccf..f57ef8c6c 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -2493,11 +2493,11 @@ sub match_glob ($$;@) { # Instead of converting the glob to a regex every time, # cache the compiled regex to save time. - if (!defined $glob_cache{$glob}) { - my $re = IkiWiki::glob2re($glob); - $glob_cache{$glob} = qr/^$re$/i; + my $re=$glob_cache{$glob}; + unless (defined $re) { + $glob_cache{$glob} = $re = IkiWiki::glob2re($glob); } - if ($page=~ $glob_cache{$glob}) { + if ($page =~ $re) { if (! IkiWiki::isinternal($page) || $params{internal}) { return IkiWiki::SuccessReason->new("$glob matches $page"); } @@ -2667,7 +2667,7 @@ sub match_user ($$;@) { return IkiWiki::ErrorReason->new("no user specified"); } - if (defined $params{user} && $params{user}=~/^$regexp$/i) { + if (defined $params{user} && $params{user}=~$regexp) { return IkiWiki::SuccessReason->new("user is $user"); } elsif (! defined $params{user}) {