]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki.pm
(no commit message)
[git.ikiwiki.info.git] / IkiWiki.pm
index f6adb360a56bcac7fca9e65e7551f6cb92c77328..7eef4c320f40b211372aa09b7be4e785a02d97ad 100644 (file)
@@ -1536,15 +1536,19 @@ sub run_hooks ($$) {
        my $sub=shift;
 
        if (exists $hooks{$type}) {
        my $sub=shift;
 
        if (exists $hooks{$type}) {
-               my @deferred;
+               my (@first, @middle, @last);
                foreach my $id (keys %{$hooks{$type}}) {
                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});
                }
        }
                        $sub->($hooks{$type}{$id}{call});
                }
        }
@@ -1654,7 +1658,7 @@ sub gettext {
 sub yesno ($) {
        my $val=shift;
 
 sub yesno ($) {
        my $val=shift;
 
-       return (defined $val && lc($val) eq gettext("yes"));
+       return (defined $val && (lc($val) eq gettext("yes") || lc($val) eq "yes" || $val eq "1"));
 }
 
 sub inject {
 }
 
 sub inject {