fixes
authorJoey Hess <joey@kodama.kitenet.net>
Mon, 7 Jan 2008 21:35:16 +0000 (16:35 -0500)
committerJoey Hess <joey@kodama.kitenet.net>
Mon, 7 Jan 2008 21:35:16 +0000 (16:35 -0500)
IkiWiki/CGI.pm

index a6695b3a5e6747942733e0cfcdbc7c40a3077e05..ea75caf9c69dc9cff86fdbe75cbacfc15437b744 100644 (file)
@@ -57,7 +57,6 @@ sub check_canedit ($$$;$) { #{{{
        my $nonfatal=shift;
        
        my $canedit;
-       my $callback;
        run_hooks(canedit => sub {
                return if defined $canedit;
                my $ret=shift->($page, $q, $session);
@@ -66,12 +65,12 @@ sub check_canedit ($$$;$) { #{{{
                                $canedit=1;
                        }
                        elsif (ref $ret eq 'CODE') {
+                               $ret->() unless $nonfatal;
                                $canedit=0;
-                               $callback->() unless $nonfatal;
                        }
                        elsif (defined $ret) {
-                               $canedit=0;
                                error($ret) unless $nonfatal;
+                               $canedit=0;
                        }
                }
        });