r94041 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r94040‎ | r94041 | r94042 >
Date:12:28, 7 August 2011
Author:ialex
Status:reverted (Comments)
Tags:
Comment:
Readd basic headers and <html>...</html> arround error contents that was removed in r90993. This caused display errors of UTF-8 characters due to the lack of these things in a DBConnectionError exception.
Modified paths:
  • /trunk/phase3/includes/Exception.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Exception.php
@@ -182,12 +182,25 @@
183183
184184 $wgOut->output();
185185 } else {
 186+ header( $_SERVER['SERVER_PROTOCOL'] . ' 500 MediaWiki Error', true, 500 );
 187+ header( 'Content-type: text/html; charset=UTF-8' );
 188+ header( 'Cache-control: none' );
 189+ header( 'Pragma: nocache' );
 190+
186191 $hookResult = $this->runHooks( get_class( $this ) . "Raw" );
187192 if ( $hookResult ) {
188193 die( $hookResult );
189194 }
190195
 196+ echo "<html>
 197+<head>
 198+<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
 199+<title>" . $this->getPageTitle() . "</title>
 200+</head>
 201+<body>
 202+";
191203 echo $this->getHTML();
 204+ echo "\n</body></html>";
192205 die(1);
193206 }
194207 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r94568Revert r94041: PHP Notice: Undefined index: SERVER_PROTOCOL in /home/ci/cruis...brion21:04, 15 August 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r90993* Remove Exception.php's reliance on wfDie(), as well as the awful constant M...demon19:46, 28 June 2011

Comments

#Comment by Brion VIBBER (talk | contribs)   21:02, 15 August 2011

PHP Notice: Undefined index: SERVER_PROTOCOL in /home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/includes/Exception.php on line 185

#Comment by Brion VIBBER (talk | contribs)   21:04, 15 August 2011

Reverted in r94568.

#Comment by Brion VIBBER (talk | contribs)   21:04, 15 August 2011

This code appears to be trying to output something like 'HTTP/1.1 500 MediaWiki Error', but using $_SERVER['SERVER_PROTOCOL']. And it seems to output it on things that run in phpunit tests. Seems pretty broken?

Status & tagging log