Revert r94041: PHP Notice: Undefined index: SERVER_PROTOCOL in /home/ci/cruisecontrol...
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 15 Aug 2011 21:04:11 +0000 (21:04 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 15 Aug 2011 21:04:11 +0000 (21:04 +0000)
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?

includes/Exception.php

index 10a409c..5a972ca 100644 (file)
@@ -182,25 +182,12 @@ class MWException extends Exception {
 
                        $wgOut->output();
                } else {
-                       header( $_SERVER['SERVER_PROTOCOL'] . ' 500 MediaWiki Error', true, 500 );
-                       header( 'Content-type: text/html; charset=UTF-8' );
-                       header( 'Cache-control: none' );
-                       header( 'Pragma: nocache' );
-
                        $hookResult = $this->runHooks( get_class( $this ) . "Raw" );
                        if ( $hookResult ) {
                                die( $hookResult );
                        }
 
-                       echo "<html>
-<head>
-<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
-<title>" . $this->getPageTitle() . "</title>
-</head>
-<body>
-";
                        echo $this->getHTML();
-                       echo "\n</body></html>";
                        die(1);
                }
        }