Correct a bug in pagespec matching, where a empty pagespec matched all pages.
authorJoey Hess <joey@kodama.kitenet.net>
Thu, 24 Apr 2008 17:49:15 +0000 (13:49 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Thu, 24 Apr 2008 17:49:15 +0000 (13:49 -0400)
This manifested as wikis with no locked pages treating them all as locked.
The bug was introduced in version 2.41.

Medium urgency upload due to above fix.

IkiWiki.pm
debian/changelog
t/pagespec_match.t

index 68047b9b94c9c187122fd3a5b61fb25c57c03c75..3802559a53d6c60569464a17b95109f9eab807a5 100644 (file)
@@ -1247,6 +1247,10 @@ sub pagespec_translate ($) { #{{{
                }
        }
 
+       if (! length $code) {
+               $code=0;
+       }
+
        return eval 'sub { my $page=shift; '.$code.' }';
 } #}}}
 
index b6e477a3c9a16fc012dce3f345d4049247d225ef..d851f35f61c8ed0ef3996b42c005ce9ebcf9876c 100644 (file)
@@ -1,9 +1,13 @@
-ikiwiki (2.44) UNRELEASED; urgency=low
+ikiwiki (2.44) unstable; urgency=medium
 
   * Bring back the svnrepo setup file option. This is needed for
     recentchangediff to work with svn repos.
   * Allow libtext-markdown-perl to satisfy dependencies, as a
     an alternative to the markdown package.
+  * Correct a bug in pagespec matching, where a empty pagespec matched all
+    pages. This manifested as wikis with no locked pages treating them all as
+    locked. The bug was introduced in version 2.41.
+  * Medium urgency upload due to above fix.
 
  -- Joey Hess <joeyh@debian.org>  Thu, 17 Apr 2008 14:33:54 -0400
 
index 038472967be3670188515982fa31f9b5419eee0c..ee255b4714036bd4cbf5ede7b0f878403c0116de 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 use warnings;
 use strict;
-use Test::More tests => 52;
+use Test::More tests => 54;
 
 BEGIN { use_ok("IkiWiki"); }
 
@@ -51,6 +51,8 @@ ok(pagespec_match("examples/softwaresite/bugs/fails_to_frobnicate",
 ok(! pagespec_match("foo", "link(./bar)", location => "foo/bar"), "link relative fail");
 ok(pagespec_match("bar", "backlink(foo)"), "backlink");
 ok(! pagespec_match("quux", "backlink(foo)"), "failed backlink");
+ok(! pagespec_match("bar", ""), "empty pagespec should match nothing");
+ok(! pagespec_match("bar", "           "), "blank pagespec should match nothing");
 
 $IkiWiki::pagectime{foo}=1154532692; # Wed Aug  2 11:26 EDT 2006
 $IkiWiki::pagectime{bar}=1154532695; # after