diff options
-rw-r--r-- | IkiWiki/Plugin/comments.pm | 4 | ||||
-rw-r--r-- | IkiWiki/Plugin/inline.pm | 3 | ||||
-rw-r--r-- | IkiWiki/Plugin/meta.pm | 20 | ||||
-rw-r--r-- | IkiWiki/Plugin/po.pm | 2 | ||||
-rw-r--r-- | debian/NEWS | 8 | ||||
-rw-r--r-- | debian/changelog | 6 | ||||
-rwxr-xr-x | debian/postinst | 2 | ||||
-rw-r--r-- | doc/bugs/some_but_not_all_meta_fields_are_stored_escaped.mdwn | 5 | ||||
-rwxr-xr-x | t/tag.t | 7 |
9 files changed, 31 insertions, 26 deletions
diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 460341710..0aa043215 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -221,9 +221,9 @@ sub preprocess { } if (defined $params{subject}) { - # encode title the same way meta does + # decode title the same way meta does eval q{use HTML::Entities}; - $pagestate{$page}{meta}{title} = HTML::Entities::encode_numeric(decode_entities($params{subject})); + $pagestate{$page}{meta}{title} = decode_entities($params{subject}); } if ($params{page} =~ m/\/\Q$config{comments_pagename}\E\d+_/) { diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 44919e58c..644cb588d 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -553,7 +553,8 @@ sub genfeed ($$$$$@) { if (exists $pagestate{$p}) { if (exists $pagestate{$p}{meta}{guid}) { - $itemtemplate->param(guid => $pagestate{$p}{meta}{guid}); + eval q{use HTML::Entities}; + $itemtemplate->param(guid => HTML::Entities::encode_numeric($pagestate{$p}{meta}{guid})); } if (exists $pagestate{$p}{meta}{updated}) { diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm index 892f6b2c9..128a6342c 100644 --- a/IkiWiki/Plugin/meta.pm +++ b/IkiWiki/Plugin/meta.pm @@ -88,26 +88,21 @@ sub preprocess (@) { # Metadata collection that needs to happen during the scan pass. if ($key eq 'title') { - my $encoded = HTML::Entities::encode_numeric($value); - $pagestate{$page}{meta}{title} = $encoded; - + $pagestate{$page}{meta}{title}=$value; if (exists $params{sortas}) { $pagestate{$page}{meta}{titlesort}=$params{sortas}; } - elsif ($encoded ne $value) { - $pagestate{$page}{meta}{titlesort}=$value; - } else { delete $pagestate{$page}{meta}{titlesort}; } return ""; } elsif ($key eq 'description') { - $pagestate{$page}{meta}{description}=HTML::Entities::encode_numeric($value); + $pagestate{$page}{meta}{description}=$value; # fallthrough } elsif ($key eq 'guid') { - $pagestate{$page}{meta}{guid}=HTML::Entities::encode_numeric($value); + $pagestate{$page}{meta}{guid}=$value; # fallthrough } elsif ($key eq 'license') { @@ -281,15 +276,20 @@ sub pagetemplate (@) { $template->param(meta => join("\n", grep { (! $seen{$_}) && ($seen{$_}=1) } @{$metaheaders{$page}})); } if (exists $pagestate{$page}{meta}{title} && $template->query(name => "title")) { - $template->param(title => $pagestate{$page}{meta}{title}); + $template->param(title => HTML::Entities::encode_numeric($pagestate{$page}{meta}{title})); $template->param(title_overridden => 1); } - foreach my $field (qw{author authorurl description permalink}) { + foreach my $field (qw{author authorurl permalink}) { $template->param($field => $pagestate{$page}{meta}{$field}) if exists $pagestate{$page}{meta}{$field} && $template->query(name => $field); } + foreach my $field (qw{description}) { + $template->param($field => HTML::Entities::encode_numeric($pagestate{$page}{meta}{$field})) + if exists $pagestate{$page}{meta}{$field} && $template->query(name => $field); + } + foreach my $field (qw{license copyright}) { if (exists $pagestate{$page}{meta}{$field} && $template->query(name => $field) && ($page eq $destpage || ! exists $pagestate{$destpage}{meta}{$field} || diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index 00c58fbe5..759e812e6 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -133,6 +133,7 @@ sub checkconfig () { $field, 'po')); } } + delete $config{po_slave_languages}{$config{po_master_language}{code}};; map { islanguagecode($_) @@ -174,7 +175,6 @@ sub checkconfig () { if ($config{po_master_language}{code} ne 'en') { # Add underlay containing translated source files # for the master language. -print STDERR "added underlay locale/$config{po_master_language}{code}/$underlay\n"; add_underlay("locale/$config{po_master_language}{code}/$underlay") if -d "$config{underlaydirbase}/locale/$config{po_master_language}{code}/$underlay"; } diff --git a/debian/NEWS b/debian/NEWS index b796154fa..25ebed0b4 100644 --- a/debian/NEWS +++ b/debian/NEWS @@ -8,10 +8,10 @@ ikiwiki (3.20100406) unstable; urgency=low not regular wikilinks. If your wiki accidentially relied on the old, buggy behavior, you might need to change pagespecs to use `link()`. - To support the above change, all wikis need to be rebuilt on upgrade to - this version. If you listed your wiki in /etc/ikiwiki/wikilist this will - be done automatically when the Debian package is upgraded. Or use - ikiwiki-mass-rebuild to force a rebuild. + Due to the above and other changes, all wikis need to be rebuilt on + upgrade to this version. If you listed your wiki in /etc/ikiwiki/wikilist + this will be done automatically when the Debian package is upgraded. Or + use ikiwiki-mass-rebuild to force a rebuild. -- Simon McVittie <smcv@debian.org> Tue, 06 Apr 2010 20:53:07 +0100 diff --git a/debian/changelog b/debian/changelog index e985a5da8..208578527 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -ikiwiki (3.20100406) UNRELEASED; urgency=low +ikiwiki (3.20100410) UNRELEASED; urgency=low [ Joey Hess ] * bzr: Fix bzr log parsing to work with bzr 2.0. (liw) @@ -18,11 +18,15 @@ ikiwiki (3.20100406) UNRELEASED; urgency=low This can be used to get names sorted by last name without displaying them last name first. * sortnaturally: New plugin; the title_natural sort method has moved here. + * meta: store fields consistently unescaped, and escape on use + A wiki rebuild is also needed due to this change. [ Joey Hess ] * Update dependency for git-core to git transition. * po: Check that translated underlay directories exist before using them for master language. + * po: Configuring the same language as master and slave confuses processing; + so filter out such a misconfiguration. -- Joey Hess <joeyh@debian.org> Sun, 04 Apr 2010 12:17:11 -0400 diff --git a/debian/postinst b/debian/postinst index 8eac26361..fa0591153 100755 --- a/debian/postinst +++ b/debian/postinst @@ -4,7 +4,7 @@ set -e # Change this when some incompatible change is made that requires # rebuilding all wikis. -firstcompat=3.20100406 +firstcompat=3.20100410 if [ "$1" = configure ] && \ dpkg --compare-versions "$2" lt "$firstcompat"; then diff --git a/doc/bugs/some_but_not_all_meta_fields_are_stored_escaped.mdwn b/doc/bugs/some_but_not_all_meta_fields_are_stored_escaped.mdwn index 8e1ca42e0..587771ba4 100644 --- a/doc/bugs/some_but_not_all_meta_fields_are_stored_escaped.mdwn +++ b/doc/bugs/some_but_not_all_meta_fields_are_stored_escaped.mdwn @@ -20,6 +20,9 @@ Points of extra subtlety: that that's what Xapian wants anyway (which is why I didn't change it), but I could be wrong... + > AFAICS, this if anything, fixes a bug, xapian definitely expects + > unescaped text here. --[[Joey]] + * Page descriptions in the HTML `<head>` were previously double-escaped: the description was stored escaped with numeric entities, then that was output with a second layer of escaping! In this branch, I just emit @@ -37,3 +40,5 @@ Points of extra subtlety: contained markup could appear unescaped on any page that inlines them in `quick=yes` mode, and is rebuilt for some other reason. The failure mode here would be too little escaping, i.e. cross-site scripting. + +[[!tag done]] @@ -3,7 +3,7 @@ package IkiWiki; use warnings; use strict; -use Test::More tests => 10; +use Test::More tests => 7; BEGIN { use_ok("IkiWiki"); } BEGIN { use_ok("IkiWiki::Plugin::tag"); } @@ -36,9 +36,4 @@ ok(!pagespec_match("two", "tagged(alpha)")); ok(pagespec_match("one", "link(tags/numbers)")); ok(pagespec_match("one", "link(alpha)")); -ok(pagespec_match("one", "typedlink(tag tags/numbers)")); -ok(!pagespec_match("one", "typedlink(tag tags/letters)")); -# invalid syntax -ok(pagespec_match("one", "typedlink(tag)")->isa("IkiWiki::ErrorReason")); - 1; |