dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "API: Use message-per-value for apihelp-query+watchlistraw-param-prop"
[lhc/web/wiklou.git]
/
includes
/
exception
/
MWException.php
diff --git
a/includes/exception/MWException.php
b/includes/exception/MWException.php
index
097c043
..
c0186f9
100644
(file)
--- a/
includes/exception/MWException.php
+++ b/
includes/exception/MWException.php
@@
-119,7
+119,8
@@
class MWException extends Exception {
if ( $this->useMessageCache() ) {
try {
return wfMessage( $key, $args )->text();
if ( $this->useMessageCache() ) {
try {
return wfMessage( $key, $args )->text();
- } catch ( Exception $e ) {}
+ } catch ( Exception $e ) {
+ }
}
return wfMsgReplaceArgs( $fallback, $args );
}
}
return wfMsgReplaceArgs( $fallback, $args );
}
@@
-237,8
+238,7
@@
class MWException extends Exception {
} elseif ( self::isCommandLine() ) {
MWExceptionHandler::printError( $this->getText() );
} else {
} elseif ( self::isCommandLine() ) {
MWExceptionHandler::printError( $this->getText() );
} else {
- self::header( 'HTTP/1.1 500 MediaWiki exception' );
- self::header( 'Status: 500 MediaWiki exception' );
+ self::statusHeader( 500 );
self::header( "Content-Type: $wgMimeType; charset=utf-8" );
$this->reportHTML();
self::header( "Content-Type: $wgMimeType; charset=utf-8" );
$this->reportHTML();
@@
-265,4
+265,9
@@
class MWException extends Exception {
header( $header );
}
}
header( $header );
}
}
+ private static function statusHeader( $code ) {
+ if ( !headers_sent() ) {
+ HttpStatus::header( $code );
+ }
+ }
}
}