mirror of
https://github.com/php/web-php.git
synced 2026-03-24 07:12:16 +01:00
Put this image redirectio to the right place
This commit is contained in:
13
error.php
13
error.php
@@ -25,8 +25,12 @@ $URI = substr($_SERVER['STRIPPED_URI'], 1);
|
||||
$URI = urldecode(preg_replace("!(\\?.*$)!", "", $URI));
|
||||
|
||||
// ============================================================================
|
||||
// For images, display a 404 automatically (no redirect)
|
||||
if (preg_match("!\\.(pdf|gif|jpg|png)$!i", $URI)) { error_404(); }
|
||||
// Perform a redirect for manual figures, other images display a 404 automatically
|
||||
if (preg_match("!^manual/(\\w+)/(print|printwn|tableless)/figures/(.+)$!", $URI, $parts)) {
|
||||
mirror_redirect("/manual/$parts[1]/figures/$parts[3]");
|
||||
} elseif (preg_match("!\\.(pdf|gif|jpg|png)$!i", $URI)) {
|
||||
error_404();
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// BC: handle .php3 files that were renamed to .php
|
||||
@@ -90,11 +94,6 @@ elseif (preg_match("!^manual/(\\w+)/(print|printwn|html|tableless)(/)?$!", $URI,
|
||||
include $_SERVER['DOCUMENT_ROOT'] . "/manual/$parts[1]/index.php";
|
||||
exit;
|
||||
}
|
||||
|
||||
// Rediretion for printed page image displays
|
||||
elseif (preg_match("!^manual/(\\w+)/(print|printwn|tableless)/figures/(.+)$!", $URI, $parts)) {
|
||||
mirror_redirect("/manual/$parts[1]/figures/$parts[3]");
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Some nice URLs for getting something for download
|
||||
|
||||
Reference in New Issue
Block a user