From 77c8660ee8a1a30129ae08edd3980caf1f9ad410 Mon Sep 17 00:00:00 2001 From: "Mr. E23" Date: Wed, 17 Dec 2003 08:30:11 +0000 Subject: [PATCH] Added <4.3.0 compatibility for wfAbruptExit() --- includes/GlobalFunctions.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index a3b098c10a..5920efee8b 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -342,6 +342,7 @@ function wfGo( $s ) $se->goResult(); } + /* private */ $wgAbruptExitCalled = false; # Just like exit() but makes a note of it. @@ -353,11 +354,17 @@ function wfAbruptExit(){ } $wgAbruptExitCalled = true; + if( ! function_exists( "debug_backtrace" )){ // for php < 4.3.0 + wfDebug("WARNING: Abrupt exit from somewhere.\n"); + exit(); + } + + wfDebug("WARNING: Abrupt exit. Backtrace follows:\n"); $bt = debug_backtrace(); for($i = 0; $i < count($bt) ; $i++){ $file = $bt[$i]["file"]; $line = $bt[$i]["line"]; - wfDebug("WARNING: Abrupt exit in $file at line $line\n"); + wfDebug("Abrupt exit in $file at line $line\n"); } exit(); } -- 2.20.1