X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/9f141841efc80dbe7a3ef8cc8fbae102c9cd190b..ec14786c900e626ff3131b55b7c0833b6e0bf9f8:/IkiWiki.pm diff --git a/IkiWiki.pm b/IkiWiki.pm index 2a3a84d9a..54e00ec7b 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -100,7 +100,7 @@ sub getsetup () { type => "string", default => '', example => "/var/www/wiki/ikiwiki.cgi", - description => "cgi wrapper to generate", + description => "filename of cgi wrapper to generate", safe => 0, # file rebuild => 0, }, @@ -949,16 +949,16 @@ sub formattime ($;$) { sub beautify_urlpath ($) { my $url=shift; - if ($config{usedirs}) { - $url =~ s!/index.$config{htmlext}$!/!; - } - # Ensure url is not an empty link, and if necessary, # add ./ to avoid colon confusion. - if ($url !~ /^\// && $url !~ /^\.\.\//) { + if ($url !~ /^\// && $url !~ /^\.\.?\//) { $url="./$url"; } + if ($config{usedirs}) { + $url =~ s!/index.$config{htmlext}$!/!; + } + return $url; } @@ -1536,15 +1536,19 @@ sub run_hooks ($$) { my $sub=shift; if (exists $hooks{$type}) { - my @deferred; + my (@first, @middle, @last); foreach my $id (keys %{$hooks{$type}}) { - if ($hooks{$type}{$id}{last}) { - push @deferred, $id; - next; + if ($hooks{$type}{$id}{first}) { + push @first, $id; + } + elsif ($hooks{$type}{$id}{last}) { + push @last, $id; + } + else { + push @middle, $id; } - $sub->($hooks{$type}{$id}{call}); } - foreach my $id (@deferred) { + foreach my $id (@first, @middle, @last) { $sub->($hooks{$type}{$id}{call}); } } @@ -1624,7 +1628,10 @@ sub globlist_to_pagespec ($) { sub is_globlist ($) { my $s=shift; - return ( $s =~ /[^\s]+\s+([^\s]+)/ && $1 ne "and" && $1 ne "or" ); + my $ret= ( $s =~ /[^\s]+\s+([^\s]+)/ && $1 ne "and" && $1 ne "or" ); + print STDERR "warning: deprecated GlobList style PageSpec \"$s\" will stop working in ikiwiki version 3.0\n" + if $ret && $s !~ /TMPL_VAR/; # hack alert + return $ret; } sub safequote ($) {