Globale Variable bei jedem Request initialisieren.
authorMoritz Bunkus <m.bunkus@linet-services.de>
Fri, 5 Feb 2010 14:04:31 +0000 (15:04 +0100)
committerSven Schöling <s.schoeling@linet-services.de>
Tue, 20 Jul 2010 08:49:47 +0000 (10:49 +0200)
SL/Dispatcher.pm
bin/mozilla/common.pl

index 7e195b4..fb88af5 100644 (file)
@@ -67,14 +67,15 @@ sub pre_startup_setup {
   # dummy globals
   {
     no warnings 'once';
-    $::userspath  = "users";
-    $::templates  = "templates";
-    $::memberfile = "users/members";
-    $::menufile   = "menu.ini";
-    $::sendmail   = "| /usr/sbin/sendmail -t";
-    $::lxdebug    = LXDebug->new;
-    $::auth       = SL::Auth->new;
-    %::myconfig   = ();
+    $::userspath   = "users";
+    $::templates   = "templates";
+    $::memberfile  = "users/members";
+    $::menufile    = "menu.ini";
+    $::sendmail    = "| /usr/sbin/sendmail -t";
+    $::lxdebug     = LXDebug->new;
+    $::auth        = SL::Auth->new;
+    %::myconfig    = ();
+    %::called_subs = ();
   }
 }
 
index 85fb3fb..b86ce78 100644 (file)
@@ -509,8 +509,6 @@ sub show_history {
 
 # -------------------------------------------------------------------------
 
-my %_called_subs = ();
-
 sub call_sub {
   $main::lxdebug->enter_sub();
 
@@ -529,8 +527,8 @@ sub call_sub {
     $form->error(sprintf($locale->text("Attempt to call an undefined sub named '%s'"), $name));
   }
 
-  $_called_subs{$name}++;
-#  confess "RECURSION DETECTION: call_sub($name) called " . $_called_subs{$name} . " time(s)" if $_called_subs{$name} > 10;
+  $::called_subs{$name}++;
+  confess "RECURSION DETECTION: call_sub($name) called " . $::called_subs{$name} . " time(s)" if $::called_subs{$name} > 10;
 
   {
     no strict "refs";