From 4ed1bcf646b1e32972cfaa312ab97e8d050387cf Mon Sep 17 00:00:00 2001 From: Alex Pott Date: Wed, 9 May 2018 08:32:57 +0100 Subject: [PATCH] Issue #2970132 by neerajsingh, webflo: .ht.router.php causes a redirect loop when invoked from parent directory --- .ht.router.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ht.router.php b/.ht.router.php index 3da80a17f2b..054f7119b0e 100644 --- a/.ht.router.php +++ b/.ht.router.php @@ -25,7 +25,7 @@ */ $url = parse_url($_SERVER['REQUEST_URI']); -if (file_exists('.' . $url['path'])) { +if (file_exists(__DIR__ . $url['path'])) { // Serve the requested resource as-is. return FALSE; } @@ -38,7 +38,7 @@ if (strpos($path, '.php') !== FALSE) { // fallback to index.php. do { $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 // script to include. $script = ltrim($path, '/');