summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-03-17 14:04:59 -0400
committerJoey Hess <joey@kodama.kitenet.net>2008-03-17 14:04:59 -0400
commit8a29361c321b54607ba5b4a7675508325b450110 (patch)
tree3f4936d273ab9e79530f6e7c260d14216f11a14e
parent6ce7454cc33e94e22490c202210eff481acfd0c1 (diff)
* Detect invalid pagespecs and do not merge them in add_depends,
as that can result in a broken merged pagespec that matches nothing.
-rw-r--r--IkiWiki.pm13
-rw-r--r--debian/changelog2
2 files changed, 15 insertions, 0 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm
index 668de7e93..bd804269d 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -1106,6 +1106,8 @@ sub add_depends ($$) { #{{{
my $page=shift;
my $pagespec=shift;
+ return unless pagespec_valid($pagespec);
+
if (! exists $depends{$page}) {
$depends{$page}=$pagespec;
}
@@ -1234,6 +1236,17 @@ sub pagespec_match ($$;@) { #{{{
return $ret;
} #}}}
+sub pagespec_valid ($) { #{{{
+ my $spec=shift;
+
+ # used by generated code
+ my $page="";
+ my @params;
+
+ eval pagespec_translate($spec);
+ return ! $@;
+} #}}}
+
package IkiWiki::FailReason;
use overload ( #{{{
diff --git a/debian/changelog b/debian/changelog
index c9fd64a2a..dc950790f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -45,6 +45,8 @@ ikiwiki (2.41) UNRELEASED; urgency=low
* external: Add getargv and setargv methods to allow access to ikiwiki's
@ARGV.
* Correct bug in encoding of %pagestate keys, fixes edittemplate.
+ * Detect invalid pagespecs and do not merge them in add_depends,
+ as that can result in a broken merged pagespec that matches nothing.
-- martin f. krafft <madduck@debian.org> Sun, 02 Mar 2008 17:46:38 +0100