dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7ece699
)
Added wfAbruptExit() function, to replace exit() calls with.
author
Mr. E23
<e23@users.mediawiki.org>
Wed, 10 Dec 2003 14:58:17 +0000
(14:58 +0000)
committer
Mr. E23
<e23@users.mediawiki.org>
Wed, 10 Dec 2003 14:58:17 +0000
(14:58 +0000)
includes/GlobalFunctions.php
patch
|
blob
|
history
diff --git
a/includes/GlobalFunctions.php
b/includes/GlobalFunctions.php
index
40effcc
..
f0641a1
100644
(file)
--- a/
includes/GlobalFunctions.php
+++ b/
includes/GlobalFunctions.php
@@
-339,7
+339,7
@@
function wfSpecialPage()
$par = NULL;
list($t, $par) = split( "/", $wgTitle->getDBkey(), 2 );
$par = NULL;
list($t, $par) = split( "/", $wgTitle->getDBkey(), 2 );
-
+
if ( array_key_exists( $t, $validSP ) ||
( $wgUser->isSysop() && array_key_exists( $t, $sysopSP ) ) ||
( $wgUser->isDeveloper() && array_key_exists( $t, $devSP ) ) ) {
if ( array_key_exists( $t, $validSP ) ||
( $wgUser->isSysop() && array_key_exists( $t, $sysopSP ) ) ||
( $wgUser->isDeveloper() && array_key_exists( $t, $devSP ) ) ) {
@@
-373,6
+373,24
@@
function wfGo( $s )
$se->goResult();
}
$se->goResult();
}
+/* private */ $wgAbruptExitCalled = false;
+
+# Just like exit() but makes a note of it.
+function wfAbruptExit(){
+ // Safety to avoid infinite recursion in case of (unlikely) bugs somewhere
+ global $wgAbruptExitCalled;
+ if ( $wgAbruptExitCalled ){
+ exit();
+ }
+ $wgAbruptExitCalled = true;
+
+ $bt = debug_backtrace();
+ $file = $bt[0]["file"];
+ $line = $bt[0]["line"];
+ wfDebug("WARNING: Abrupt exit in $file at line $line\n");
+ exit();
+}
+
function wfNumberOfArticles()
{
global $wgNumberOfArticles;
function wfNumberOfArticles()
{
global $wgNumberOfArticles;