]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/meta.pm
Merge branch 'master' into comments
[git.ikiwiki.info.git] / IkiWiki / Plugin / meta.pm
index b2c85c892146f21f76639fc1f498a35b61007f1f..3991797c0fe6f7be305e9b3e799f5aaa7bdc7ae2 100644 (file)
@@ -38,9 +38,10 @@ sub needsbuild (@) { #{{{
        }
 }
 
        }
 }
 
-sub scrub ($) { #{{{
+sub scrub ($$) { #{{{
        if (IkiWiki::Plugin::htmlscrubber->can("sanitize")) {
        if (IkiWiki::Plugin::htmlscrubber->can("sanitize")) {
-               return IkiWiki::Plugin::htmlscrubber::sanitize(content => shift);
+               return IkiWiki::Plugin::htmlscrubber::sanitize(
+                       content => shift, destpage => shift);
        }
        else {
                return shift;
        }
        else {
                return shift;
@@ -137,7 +138,7 @@ sub preprocess (@) { #{{{
        elsif ($key eq 'permalink') {
                if (safeurl($value)) {
                        $pagestate{$page}{meta}{permalink}=$value;
        elsif ($key eq 'permalink') {
                if (safeurl($value)) {
                        $pagestate{$page}{meta}{permalink}=$value;
-                       push @{$metaheaders{$page}}, scrub('<link rel="bookmark" href="'.encode_entities($value).'" />');
+                       push @{$metaheaders{$page}}, scrub('<link rel="bookmark" href="'.encode_entities($value).'" />', $destpage);
                }
        }
        elsif ($key eq 'stylesheet') {
                }
        }
        elsif ($key eq 'stylesheet') {
@@ -206,7 +207,7 @@ sub preprocess (@) { #{{{
                my $delay=int(exists $params{delay} ? $params{delay} : 0);
                my $redir="<meta http-equiv=\"refresh\" content=\"$delay; URL=$value\" />";
                if (! $safe) {
                my $delay=int(exists $params{delay} ? $params{delay} : 0);
                my $redir="<meta http-equiv=\"refresh\" content=\"$delay; URL=$value\" />";
                if (! $safe) {
-                       $redir=scrub($redir);
+                       $redir=scrub($redir, $destpage);
                }
                push @{$metaheaders{$page}}, $redir;
        }
                }
                push @{$metaheaders{$page}}, $redir;
        }
@@ -216,7 +217,7 @@ sub preprocess (@) { #{{{
                                join(" ", map {
                                        encode_entities($_)."=\"".encode_entities(decode_entities($params{$_}))."\""
                                } keys %params).
                                join(" ", map {
                                        encode_entities($_)."=\"".encode_entities(decode_entities($params{$_}))."\""
                                } keys %params).
-                               " />\n");
+                               " />\n", $destpage);
                }
        }
        elsif ($key eq 'robots') {
                }
        }
        elsif ($key eq 'robots') {
@@ -225,7 +226,7 @@ sub preprocess (@) { #{{{
        }
        else {
                push @{$metaheaders{$page}}, scrub('<meta name="'.encode_entities($key).
        }
        else {
                push @{$metaheaders{$page}}, scrub('<meta name="'.encode_entities($key).
-                       '" content="'.encode_entities($value).'" />');
+                       '" content="'.encode_entities($value).'" />', $destpage);
        }
 
        return "";
        }
 
        return "";
@@ -273,7 +274,7 @@ sub match { #{{{
                $val=$pagestate{$page}{meta}{$field};
        }
        elsif ($field eq 'title') {
                $val=$pagestate{$page}{meta}{$field};
        }
        elsif ($field eq 'title') {
-               $val = IkiWiki::pagetitle($page);
+               $val = pagetitle($page);
        }
 
        if (defined $val) {
        }
 
        if (defined $val) {