From fd574abba34aa0c58882ec32ebadb13551d9e77b Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 5 Feb 2010 15:04:31 +0100 Subject: [PATCH] Globale Variable bei jedem Request initialisieren. --- SL/Dispatcher.pm | 17 +++++++++-------- bin/mozilla/common.pl | 6 ++---- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/SL/Dispatcher.pm b/SL/Dispatcher.pm index 7e195b486..fb88af58e 100644 --- a/SL/Dispatcher.pm +++ b/SL/Dispatcher.pm @@ -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 = (); } } diff --git a/bin/mozilla/common.pl b/bin/mozilla/common.pl index 85fb3fbf9..b86ce78a1 100644 --- a/bin/mozilla/common.pl +++ b/bin/mozilla/common.pl @@ -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"; -- 2.20.1