r36486 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r36485‎ | r36486 | r36487 >
Date:23:22, 19 June 2008
Author:brion
Status:old
Tags:
Comment:
replace live hack: include debug info in thumb.php (switch it in with $wgShowHostnames)
Modified paths:
  • /trunk/phase3/thumb.php (modified) (history)

Diff [purge]

Index: trunk/phase3/thumb.php
@@ -117,6 +117,7 @@
118118 }
119119
120120 function wfThumbError( $status, $msg ) {
 121+ global $wgShowHostnames;
121122 header( 'Cache-Control: no-cache' );
122123 header( 'Content-Type: text/html; charset=utf-8' );
123124 if ( $status == 404 ) {
@@ -124,6 +125,13 @@
125126 } else {
126127 header( 'HTTP/1.1 500 Internal server error' );
127128 }
 129+ if( $wgShowHostnames ) {
 130+ $url = htmlspecialchars( @$_SERVER['REQUEST_URI'] );
 131+ $hostname = htmlspecialchars( wfHostname() );
 132+ $debug = "<!-- $url -->\n<!-- $hostname -->\n";
 133+ } else {
 134+ $debug = "";
 135+ }
128136 echo <<<EOT
129137 <html><head><title>Error generating thumbnail</title></head>
130138 <body>
@@ -131,6 +139,7 @@
132140 <p>
133141 $msg
134142 </p>
 143+$debug
135144 </body>
136145 </html>
137146

Status & tagging log