Avoid infinite loop when an exception occurs in command line mode
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Wed, 29 Jul 2009 14:38:28 +0000 (14:38 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Wed, 29 Jul 2009 14:38:28 +0000 (14:38 +0000)
includes/Profiler.php

index 80a6a68..4046a58 100644 (file)
@@ -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' );
                }