]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
Merge branch 'master' of ssh://git.ikiwiki.info/srv/git/ikiwiki.info
authorJoey Hess <joey@gnu.kitenet.net>
Sat, 10 Apr 2010 22:29:20 +0000 (18:29 -0400)
committerJoey Hess <joey@gnu.kitenet.net>
Sat, 10 Apr 2010 22:29:20 +0000 (18:29 -0400)
IkiWiki/Plugin/comments.pm
IkiWiki/Plugin/inline.pm
IkiWiki/Plugin/meta.pm
IkiWiki/Plugin/po.pm
debian/NEWS
debian/changelog
debian/postinst
doc/bugs/some_but_not_all_meta_fields_are_stored_escaped.mdwn
t/tag.t

index 4603417103c3abdb3e4d16beb6c60c8c90f05118..0aa043215b35a5ab32b2219dfc5410ac64c507cc 100644 (file)
@@ -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+_/) {
index 44919e58c35d658535fbb6e8e2e6f745e3c69311..644cb588d6d0283237f62d92208e58011642ee3a 100644 (file)
@@ -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}) {
index 892f6b2c96a46e93e610a1690d5f19ffa50b7703..128a6342c74a4ad13adb2f0521d85ddfb29232bb 100644 (file)
@@ -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} ||
index 00c58fbe54f4992dd802496157ecd267a2ac30bf..759e812e61bb3218be256504585ee61e122dd4ee 100644 (file)
@@ -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";
                }
index b796154fa2f52506742b2656147d672347401c60..25ebed0b4aac2d3995edecc11ee5133eae8ae4bf 100644 (file)
@@ -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
 
index e985a5da8abf9b434c150a721fd3b2107cc68650..2085785276f447b2d8693731f08e1c13575d8f05 100644 (file)
@@ -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
 
index 8eac263618914639a2f4e96138269a7e7ab74679..fa059115381024d74f720dc3eeab29ab8514cc61 100755 (executable)
@@ -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
index 8e1ca42e04432e4d32282e344c6dca9a3afb9c3a..587771ba4c274c685b79c36fc7582bbffefc839d 100644 (file)
@@ -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]]
diff --git a/t/tag.t b/t/tag.t
index cf3bbdf01edbacdd691ba758afc25ada80b7969a..fe547d85bc51eaa306d85b90e28d79d4793f8a4e 100755 (executable)
--- a/t/tag.t
+++ b/t/tag.t
@@ -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;