summaryrefslogtreecommitdiff
path: root/includes/StreamFile.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/StreamFile.php')
-rw-r--r--includes/StreamFile.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/includes/StreamFile.php b/includes/StreamFile.php
index 83417185..81538a84 100644
--- a/includes/StreamFile.php
+++ b/includes/StreamFile.php
@@ -6,10 +6,12 @@ function wfStreamFile( $fname ) {
$stat = @stat( $fname );
if ( !$stat ) {
header( 'HTTP/1.0 404 Not Found' );
+ $encFile = htmlspecialchars( $fname );
+ $encScript = htmlspecialchars( $_SERVER['SCRIPT_NAME'] );
echo "<html><body>
<h1>File not found</h1>
-<p>Although this PHP script ({$_SERVER['SCRIPT_NAME']}) exists, the file requested for output
-does not.</p>
+<p>Although this PHP script ($encScript) exists, the file requested for output
+($encFile) does not.</p>
</body></html>";
return;
}
@@ -64,7 +66,7 @@ function wfGetType( $filename ) {
return 'unknown/unknown';
}
else {
- $magic=& wfGetMimeMagic();
+ $magic=& MimeMagic::singleton();
return $magic->guessMimeType($filename); //full fancy mime detection
}
}