From: Moritz Bunkus Date: Tue, 12 Jan 2010 09:47:30 +0000 (+0100) Subject: Endlose Rekursionen via call_sub vermeiden. X-Git-Tag: release-2.6.2beta1~331^2~18 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=0e079eba45bcb834792660358b2e86dcb70e494e;p=kivitendo-erp.git Endlose Rekursionen via call_sub vermeiden. --- diff --git a/bin/mozilla/common.pl b/bin/mozilla/common.pl index defa5f1b0..c8ab34033 100644 --- a/bin/mozilla/common.pl +++ b/bin/mozilla/common.pl @@ -9,6 +9,7 @@ # ###################################################################### +use Carp; use SL::Common; use SL::DBUtils; use SL::Form; @@ -508,6 +509,8 @@ sub show_history { # ------------------------------------------------------------------------- +my %_called_subs = (); + sub call_sub { $main::lxdebug->enter_sub(); @@ -526,6 +529,9 @@ 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; + { no strict "refs"; &{ $name }(@_);