X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/321bf7ec19641d12626c71f87792b4edf40aa306..853fcc2b56d72462901ee0f72621d02cb97dc2a3:/IkiWiki.pm diff --git a/IkiWiki.pm b/IkiWiki.pm index 57e23fda8..c06751dd3 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1201,7 +1201,7 @@ sub userpage ($) { sub openiduser ($) { my $user=shift; - if ($user =~ m!^https?://! && + if (defined $user && $user =~ m!^https?://! && eval q{use Net::OpenID::VerifiedIdentity; 1} && !$@) { my $display; @@ -2388,7 +2388,7 @@ sub glob2re ($) { my $re=quotemeta(shift); $re=~s/\\\*/.*/g; $re=~s/\\\?/./g; - return $re; + return qr/^$re$/i; } package IkiWiki::FailReason; @@ -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}) {