Skip to content

Commit 1f4a628

Browse files
committed
move $URI.php test higher up in error.php (phpweb bug #67871)
This test was below (way below) the $URI = strtolower($URI) line, so when browsing to /manual/pt_BR/function.strpos we were looking for /manual/pt_br/function.strpos.php which doesn't exist (on case-sensitive filesystems). Note: This is a quick fix... if it causes (significant) issues, we might have to think of a more involved solution than shuffling the code up the file by a few hundred lines.
1 parent 3ca803e commit 1f4a628

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

error.php

+11-9
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,17 @@
189189
if (is_numeric($URI)) {
190190
mirror_redirect("http://bugs.php.net/bug.php?id=$URI");
191191
}
192+
193+
// ============================================================================
194+
// Redirect if the entered URI was a PHP page name (except some pages,
195+
// which we display in the mirror's language or the explicitly specified
196+
// language [see below])
197+
if (!in_array($URI, array('mirror-info', 'error', 'mod')) &&
198+
file_exists($_SERVER['DOCUMENT_ROOT'] . "/$URI.php")) {
199+
echo($_SERVER['DOCUMENT_ROOT'] . "/$URI.php");
200+
exit;
201+
mirror_redirect("/$URI.php");
202+
}
192203

193204
// Work with lowercased URI from now
194205
$URI = strtolower($URI);
@@ -485,15 +496,6 @@
485496
$URI = $uri_aliases[$URI];
486497
}
487498

488-
// ============================================================================
489-
// Redirect if the entered URI was a PHP page name (except some pages,
490-
// which we display in the mirror's language or the explicitly specified
491-
// language [see below])
492-
if (!in_array($URI, array('mirror-info', 'error', 'mod')) &&
493-
file_exists($_SERVER['DOCUMENT_ROOT'] . "/$URI.php")) {
494-
mirror_redirect("/$URI.php");
495-
}
496-
497499
// ============================================================================
498500
// Execute external redirect if a rule exists for the URI
499501
if (isset($external_redirects[$URI])) {

0 commit comments

Comments
 (0)