Skip to content
Snippets Groups Projects
Unverified Commit 4ed1bcf6 authored by Alex Pott's avatar Alex Pott
Browse files

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
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -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, '/');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment