Unverified Commit 4ed1bcf6 authored by alexpott's avatar alexpott

Issue #2970132 by neerajsingh, webflo: .ht.router.php causes a redirect loop...

Issue #2970132 by neerajsingh, webflo: .ht.router.php causes a redirect loop when invoked from parent directory
parent 154f2828
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
*/ */
$url = parse_url($_SERVER['REQUEST_URI']); $url = parse_url($_SERVER['REQUEST_URI']);
if (file_exists('.' . $url['path'])) { if (file_exists(__DIR__ . $url['path'])) {
// Serve the requested resource as-is. // Serve the requested resource as-is.
return FALSE; return FALSE;
} }
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
// fallback to index.php. // fallback to index.php.
do { do {
$path = dirname($path); $path = dirname($path);
if (preg_match('/\.php$/', $path) && is_file('.' . $path)) { if (preg_match('/\.php$/', $path) && is_file(__DIR__ . $path)) {
// Discovered that the path contains an existing PHP file. Use that as the // Discovered that the path contains an existing PHP file. Use that as the
// script to include. // script to include.
$script = ltrim($path, '/'); $script = ltrim($path, '/');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment