Set content type on error messages, and include a trailing newline
authorTim Starling <tstarling@users.mediawiki.org>
Sun, 12 Nov 2006 10:44:48 +0000 (10:44 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sun, 12 Nov 2006 10:44:48 +0000 (10:44 +0000)
includes/StreamFile.php
thumb.php

index 6f0f6b5..6418269 100644 (file)
@@ -7,13 +7,15 @@ function wfStreamFile( $fname ) {
        if ( !$stat ) {
                header( 'HTTP/1.0 404 Not Found' );
                header( 'Cache-Control: no-cache' );
+               header( 'Content-Type: text/html' );
                $encFile = htmlspecialchars( $fname );
                $encScript = htmlspecialchars( $_SERVER['SCRIPT_NAME'] );
                echo "<html><body>
 <h1>File not found</h1>
 <p>Although this PHP script ($encScript) exists, the file requested for output 
 ($encFile) does not.</p>
-</body></html>";
+</body></html>
+";
                return;
        }
 
index 9f7ed88..c325d07 100644 (file)
--- a/thumb.php
+++ b/thumb.php
@@ -74,12 +74,14 @@ if ( $thumb && $thumb->path ) {
        $badtitle = wfMsg( 'badtitle' );
        $badtitletext = wfMsg( 'badtitletext' );
        header( 'Cache-Control: no-cache' );
+       header( 'Content-Type: text/html' );
        echo "<html><head>
        <title>$badtitle</title>
        <body>
 <h1>$badtitle</h1>
 <p>$badtitletext</p>
-</body></html>";
+</body></html>
+";
 }
 
 wfProfileOut( 'thumb.php-render' );