From: Brion Vibber Date: Mon, 8 Mar 2004 02:50:04 +0000 (+0000) Subject: More unitialized variable cleanup && 'pure' register_globals cleanup... X-Git-Tag: 1.3.0beta1~842 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=51f738ea9a198d11e78cf030dce54f814fa8bc69;p=lhc%2Fweb%2Fwiklou.git More unitialized variable cleanup && 'pure' register_globals cleanup... Added wfDebugDieBacktrace() function to help in pinpointing problems by showing a function call backtrace along with a friendly die message. --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 8322905e24..3fdba5e879 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -353,8 +353,13 @@ function wfSpecialPage() $wgOut->setArticleRelated( false ); $wgOut->setRobotpolicy( "noindex,follow" ); - $par = NULL; - list($t, $par) = split( "/", $wgTitle->getDBkey(), 2 ); + $bits = split( "/", $wgTitle->getDBkey(), 2 ); + $t = $bits[0]; + if( empty( $bits[1] ) ) { + $par = NULL; + } else { + $par = $bits[1]; + } if ( array_key_exists( $t, $validSP ) || ( $wgUser->isSysop() && array_key_exists( $t, $sysopSP ) ) || @@ -410,6 +415,19 @@ function wfAbruptExit(){ exit(); } +function wfDebugDieBacktrace( $msg = "" ) { + $msg .= "\n

Backtrace:

\n