replace live hack: include debug info in thumb.php (switch it in with $wgShowHostnames)
This commit is contained in:
parent
636f1ce511
commit
95b4aef2dc
1 changed files with 9 additions and 0 deletions
|
|
@ -117,6 +117,7 @@ function wfThumbMain() {
|
|||
}
|
||||
|
||||
function wfThumbError( $status, $msg ) {
|
||||
global $wgShowHostnames;
|
||||
header( 'Cache-Control: no-cache' );
|
||||
header( 'Content-Type: text/html; charset=utf-8' );
|
||||
if ( $status == 404 ) {
|
||||
|
|
@ -124,6 +125,13 @@ function wfThumbError( $status, $msg ) {
|
|||
} else {
|
||||
header( 'HTTP/1.1 500 Internal server error' );
|
||||
}
|
||||
if( $wgShowHostnames ) {
|
||||
$url = htmlspecialchars( @$_SERVER['REQUEST_URI'] );
|
||||
$hostname = htmlspecialchars( wfHostname() );
|
||||
$debug = "<!-- $url -->\n<!-- $hostname -->\n";
|
||||
} else {
|
||||
$debug = "";
|
||||
}
|
||||
echo <<<EOT
|
||||
<html><head><title>Error generating thumbnail</title></head>
|
||||
<body>
|
||||
|
|
@ -131,6 +139,7 @@ function wfThumbError( $status, $msg ) {
|
|||
<p>
|
||||
$msg
|
||||
</p>
|
||||
$debug
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue