}
$backtrace = debug_backtrace();
foreach( $backtrace as $call ) {
- $f = explode( DIRECTORY_SEPARATOR, $call['file'] );
- $file = $f[count($f)-1];
+ if( isset( $call['file'] ) ) {
+ $f = explode( DIRECTORY_SEPARATOR, $call['file'] );
+ $file = $f[count($f)-1];
+ } else {
+ $file = '-';
+ }
+ if( isset( $call['line'] ) ) {
+ $line = $call['line'];
+ } else {
+ $line = '-';
+ }
if ( $wgCommandLineMode ) {
- $msg .= "$file line {$call['line']} calls ";
+ $msg .= "$file line $line calls ";
} else {
- $msg .= '<li>' . $file . ' line ' . $call['line'] . ' calls ';
+ $msg .= '<li>' . $file . ' line ' . $line . ' calls ';
}
if( !empty( $call['class'] ) ) $msg .= $call['class'] . '::';
$msg .= $call['function'] . '()';
} elseif (preg_match("/^(\d{1,13})$/",$ts,$datearray)) {
# TS_UNIX
$uts=$ts;
+ } else {
+ # Bogus value; fall back to the epoch...
+ wfDebug("wfTimestamp() given bogus time value.\n");
+ $uts = 0;
}
if ($ts==0)
case TS_RFC2822:
return gmdate( "D, j M Y H:i:s", $uts ) . ' GMT';
default:
- return;
+ wfDebugDieBacktrace( 'wfTimestamp() called with illegal output type.');
}
}