Commit:    934b2bf82394d936c7fad0a5bfb1b2c4ac25609c
Author:    Hannes Magnusson <[email protected]>         Sun, 13 Apr 2014 
09:48:41 -0700
Parents:   75d0e8cf8fe25867b437caf4f718d523cb6a2e4e
Branches:  master

Link:       
http://git.php.net/?p=web/php.git;a=commitdiff;h=934b2bf82394d936c7fad0a5bfb1b2c4ac25609c

Log:
Fixed bug#67062 (Requesting nonexistent files should produce HTTP 404 Not Found)

Bugs:
https://bugs.php.net/67062

Changed paths:
  M  error.php


Diff:
diff --git a/error.php b/error.php
index 23165b9..14423a7 100644
--- a/error.php
+++ b/error.php
@@ -170,13 +170,15 @@ if (preg_match("!^get/([^/]+)/from/([^/]+)(/mirror)?$!", 
$URI, $dlinfo)) {
         error_nomirror($mr);
         exit;
     }
+
     // Start the download process
-    status_header(200);
     include $_SERVER['DOCUMENT_ROOT'] . "/include/do-download.inc";
     $filename = get_actual_download_file($df);
     if ($filename) {
+        status_header(200);
         download_file($mr, $filename);
     } else {
+        status_header(404);
         /* The file didn't exist on this server.. ask the user to pick another 
mirror */
         include $_SERVER['DOCUMENT_ROOT'] . "/include/get-download.inc";
     }


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to