]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki.pm
add news item for ikiwiki 3.20101129
[ikiwiki.git] / IkiWiki.pm
index bb7d46ccfb63f8de96a4246b49de1dea67d9b8ea..c06751dd36bc0bf656e9b7abfc49d5c8a9455c47 100644 (file)
@@ -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;
 
@@ -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}) {