[interchange-cvs] interchange - jon modified lib/Vend/Dispatch.pm

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Fri Feb 10 10:02:41 EST 2006


User:      jon
Date:      2006-02-10 15:02:40 GMT
Modified:  lib/Vend Dispatch.pm
Log:
Fix bug that allowed code called by DispatchRoutines or CleanupRoutines
to overwrite the routines arrays themselves.

Found and fixed by Frederic Steinfels <fredo at dvdupgrades.ch>.

Revision  Changes    Path
1.63      +6 -10     interchange/lib/Vend/Dispatch.pm


rev 1.63, prev_rev 1.62
Index: Dispatch.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Dispatch.pm,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -u -r1.62 -r1.63
--- Dispatch.pm	4 Feb 2006 18:24:12 -0000	1.62
+++ Dispatch.pm	10 Feb 2006 15:02:40 -0000	1.63
@@ -1,6 +1,6 @@
 # Vend::Dispatch - Handle Interchange page requests
 #
-# $Id: Dispatch.pm,v 1.62 2006/02/04 18:24:12 jon Exp $
+# $Id: Dispatch.pm,v 1.63 2006/02/10 15:02:40 jon Exp $
 #
 # Copyright (C) 2002-2006 Interchange Development Group
 # Copyright (C) 2002 Mike Heins <mike at perusion.net>
@@ -26,7 +26,7 @@
 package Vend::Dispatch;
 
 use vars qw($VERSION);
-$VERSION = substr(q$Revision: 1.62 $, 10);
+$VERSION = substr(q$Revision: 1.63 $, 10);
 
 use POSIX qw(strftime);
 use Vend::Util;
@@ -1457,10 +1457,8 @@
 	}
 # END LEGACY
 
-	if(my $ary = $Vend::Cfg->{DispatchRoutines}) {
-		for(@$ary) {
-			$_->();
-		}
+	for my $routine (@{$Vend::Cfg->{DispatchRoutines}}) {
+		$routine->();
 	}
 
 #show_times("end dispatch routines (Autoload, etc.)") if $Global::ShowTimes;
@@ -1639,10 +1637,8 @@
 	do_page() if $status;
 #show_times("end page display") if $Global::ShowTimes;
 
-	if(my $ary = $Vend::Cfg->{CleanupRoutines}) {
-		for(@$ary) {
-			$_->();
-		}
+	for my $routine (@{$Vend::Cfg->{CleanupRoutines}}) {
+		$routine->();
 	}
   }
 








More information about the interchange-cvs mailing list