]> sipb.mit.edu Git - ikiwiki.git/blob - doc/bugs/Meta_plugin_does_not_respect_htmlscrubber__95__skip_setting.___40__patch__41__.mdwn
(no commit message)
[ikiwiki.git] / doc / bugs / Meta_plugin_does_not_respect_htmlscrubber__95__skip_setting.___40__patch__41__.mdwn
1 I have been trying to include some meta info using the link setting something like the below
2
3  meta link="http://www.example.com/" rel="command" name="Example"    
4
5 This gets removed by the htmlscrubber as you would expect.
6
7 Setting htmlscrubber_skip to the pagespec should stop this getting scrubbed but it does not.
8
9 Below is a patch to fix that. It seams to work but I am not sure of it is the correct thing to do.
10
11 --- meta.pm     2008-12-11 17:50:33.000000000 +0000
12 +++ meta.pm.orig        2008-12-10 17:41:23.000000000 +0000
13 @@ -38,9 +38,10 @@
14         }
15  }
16  
17 -sub scrub (@) { #{{{
18 +sub scrub ($) { #{{{
19         if (IkiWiki::Plugin::htmlscrubber->can("sanitize")) {
20 -               return IkiWiki::Plugin::htmlscrubber::sanitize(content => shift, destpage => shift);
21 +               #return IkiWiki::Plugin::htmlscrubber::sanitize(content => shift);
22 +               return shift;
23         }
24         else {
25                 return shift;
26 @@ -137,7 +138,7 @@
27         elsif ($key eq 'permalink') {
28                 if (safeurl($value)) {
29                         $pagestate{$page}{meta}{permalink}=$value;
30 -                       push @{$metaheaders{$page}}, scrub('<link rel="bookmark" href="'.encode_entities($value).'" />', $page);
31 +                       push @{$metaheaders{$page}}, scrub('<link rel="bookmark" href="'.encode_entities($value).'" />');
32                 }
33         }
34         elsif ($key eq 'stylesheet') {
35 @@ -206,7 +207,7 @@
36                 my $delay=int(exists $params{delay} ? $params{delay} : 0);
37                 my $redir="<meta http-equiv=\"refresh\" content=\"$delay; URL=$value\" />";
38                 if (! $safe) {
39 -                       $redir=scrub($redir, $page);
40 +                       $redir=scrub($redir);
41                 }
42                 push @{$metaheaders{$page}}, $redir;
43         }
44 @@ -216,7 +217,7 @@
45                                 join(" ", map {
46                                         encode_entities($_)."=\"".encode_entities(decode_entities($params{$_}))."\""
47                                 } keys %params).
48 -                               " />\n", $page);
49 +                               " />\n");
50                 }
51         }
52         elsif ($key eq 'robots') {
53 @@ -225,7 +226,7 @@
54         }
55         else {
56                 push @{$metaheaders{$page}}, scrub('<meta name="'.encode_entities($key).
57 -                       '" content="'.encode_entities($value).'" />', $page);
58 +                       '" content="'.encode_entities($value).'" />');
59         }
60  
61         return "";
62