]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/meta.pm
Use local paths for redirection where possible
[ikiwiki.git] / IkiWiki / Plugin / meta.pm
index ae593555e72010dfea12c248631d7e883d9df6c8..47007afe286bd780eba392fde2fa2b20039ec73e 100644 (file)
@@ -198,8 +198,12 @@ sub preprocess (@) {
                                '" rel="openid2.local_id" />' if $delegate ne 1;
                }
                if (exists $params{"xrds-location"} && safeurl($params{"xrds-location"})) {
+                       # force url absolute
+                       eval q{use URI};
+                       error($@) if $@;
+                       my $url=URI->new_abs($params{"xrds-location"}, $config{url});
                        push @{$metaheaders{$page}}, '<meta http-equiv="X-XRDS-Location" '.
-                               'content="'.encode_entities($params{"xrds-location"}).'" />';
+                               'content="'.encode_entities($url).'" />';
                }
        }
        elsif ($key eq 'redir') {
@@ -351,7 +355,7 @@ sub match {
        }
 
        if (defined $val) {
-               if ($val=~/^$re$/i) {
+               if ($val=~$re) {
                        return IkiWiki::SuccessReason->new("$re matches $field of $page", $page => $IkiWiki::DEPEND_CONTENT, "" => 1);
                }
                else {