From 0c4280dc38c044a554db6d551a7431e2dd15e5b9 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Wed, 29 Jul 2009 14:38:28 +0000 Subject: [PATCH] Avoid infinite loop when an exception occurs in command line mode --- includes/Profiler.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/includes/Profiler.php b/includes/Profiler.php index 80a6a68a55..4046a58683 100644 --- a/includes/Profiler.php +++ b/includes/Profiler.php @@ -128,6 +128,12 @@ class Profiler { * called by wfProfileClose() */ function close() { + global $wgProfiling; + + # Avoid infinite loop + if( !$wgProfiling ) + return; + while( count( $this->mWorkStack ) ){ $this->profileOut( 'close' ); } -- 2.20.1