X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/4763514861457c295cadb7dbc7c0697ce682004f..aaea01b924a7512cb873b733e6a1b15fb3c8ed17:/IkiWiki.pm diff --git a/IkiWiki.pm b/IkiWiki.pm index cdc0ab74e..bd804269d 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -658,7 +658,7 @@ sub linkify ($$$) { #{{{ run_hooks(linkify => sub { $content=shift->( page => $page, - destpage => $page, + destpage => $destpage, content => $content, ); }); @@ -962,7 +962,7 @@ sub saveindex () { #{{{ if (exists $pagestate{$page}) { foreach my $id (@hookids) { foreach my $key (keys %{$pagestate{$page}{$id}}) { - $line.=' '.$id.'_'.encode_entities($key)."=".encode_entities($pagestate{$page}{$id}{$key}, " \t\n"); + $line.=' '.$id.'_'.encode_entities($key, " \t\n")."=".encode_entities($pagestate{$page}{$id}{$key}, " \t\n"); } } } @@ -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 ( #{{{