}
wfSuppressWarnings();
- if( is_object( $message ) ) {
+ if( is_object( $lang ) ) {
$message = $lang->getMessage( $key );
} else {
$message = '';
}
$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'] . '()';
*/
function wfEscapeWikiText( $text ) {
$text = str_replace(
- array( '[', '|', "'", 'ISBN ' , '://' , "\n=", '{{' ),
+ array( '[', '|', '\'', 'ISBN ' , '://' , "\n=", '{{' ),
array( '[', '|', ''', 'ISBN ', '://' , "\n=", '{{' ),
htmlspecialchars($text) );
return $text;
*/
function wfVarDump( $var ) {
global $wgOut;
- $s = str_replace("\n","<br>\n", var_export( $var, true ) . "\n");
+ $s = str_replace("\n","<br />\n", var_export( $var, true ) . "\n");
if ( headers_sent() || !@is_object( $wgOut ) ) {
print $s;
} else {
# Don't send content if it's a HEAD request.
if( $_SERVER['REQUEST_METHOD'] == 'HEAD' ) {
header( 'Content-type: text/plain' );
- print "$desc\n";
+ print $desc."\n";
}
}
} 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_DB:
return gmdate( 'Y-m-d H:i:s', $uts );
case TS_RFC2822:
- return gmdate( "D, j M Y H:i:s", $uts ) . ' GMT';
+ return gmdate( 'D, d M Y H:i:s', $uts ) . ' GMT';
default:
- return;
+ wfDebugDieBacktrace( 'wfTimestamp() called with illegal output type.');
}
}