mirror of
https://github.com/processwire/processwire.git
synced 2025-08-10 08:44:46 +02:00
Fix issue processwire/processwire-issues#1684
This commit is contained in:
@@ -11,7 +11,7 @@
|
|||||||
* ~~~~~
|
* ~~~~~
|
||||||
* #pw-body
|
* #pw-body
|
||||||
*
|
*
|
||||||
* ProcessWire 3.x, Copyright 2022 by Ryan Cramer
|
* ProcessWire 3.x, Copyright 2023 by Ryan Cramer
|
||||||
* https://processwire.com
|
* https://processwire.com
|
||||||
*
|
*
|
||||||
* @method Page|NullPage getPage()
|
* @method Page|NullPage getPage()
|
||||||
@@ -301,15 +301,16 @@ class PagesRequest extends Wire {
|
|||||||
|
|
||||||
// populate request path to class as other methods will now use it
|
// populate request path to class as other methods will now use it
|
||||||
$this->setRequestPath($path);
|
$this->setRequestPath($path);
|
||||||
|
|
||||||
// determine if index.php is referenced in URL
|
// determine if original URL had anything filtered out of path that will suggest a redirect
|
||||||
if(stripos($this->dirtyUrl, 'index.php') !== false && stripos($path, 'index.php') === false) {
|
list($dirtyUrl,) = explode('?', "$this->dirtyUrl?", 2); // exclude query string
|
||||||
|
if(stripos($dirtyUrl, 'index.php') !== false && stripos($path, 'index.php') === false) {
|
||||||
// force pathFinder to detect a redirect condition without index.php
|
// force pathFinder to detect a redirect condition without index.php
|
||||||
$path = rtrim($path, '/') . '/index.php';
|
$dirtyUrl = strtolower(rtrim($dirtyUrl, '/'));
|
||||||
} else if(strpos($this->dirtyUrl, '//') !== false) {
|
if(substr("/$dirtyUrl", -10) === '/index.php') $path = rtrim($path, '/') . '/index.php';
|
||||||
|
} else if(strpos($dirtyUrl, '//') !== false) {
|
||||||
// force pathFinder to detect redirect sans double slashes, /page/path// => /page/path/
|
// force pathFinder to detect redirect sans double slashes, /page/path// => /page/path/
|
||||||
list($dirtyUrl,) = explode('?', "$this->dirtyUrl?", 2); // exclude query string
|
$path = rtrim($path, '/') . '//';
|
||||||
if(strpos($dirtyUrl, '//') !== false) $path = rtrim($path, '/') . '//';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// get info about requested path
|
// get info about requested path
|
||||||
|
Reference in New Issue
Block a user