From da73398da16bb00741ea4fd2d305765ac69c17b1 Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Mon, 8 Apr 2019 06:12:24 -0400 Subject: [PATCH] Fix issue processwire/processwire-issues#843 --- wire/modules/Process/ProcessPageView.module | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wire/modules/Process/ProcessPageView.module b/wire/modules/Process/ProcessPageView.module index d88d9da6..8a4216ae 100644 --- a/wire/modules/Process/ProcessPageView.module +++ b/wire/modules/Process/ProcessPageView.module @@ -113,7 +113,7 @@ class ProcessPageView extends Process { if(empty($this->dirtyURL) && !empty($_SERVER['QUERY_STRING'])) $this->dirtyURL = '?' . $_SERVER['QUERY_STRING']; // check if there is an 'it' GET variable present in the request URL query string, which we don't want here - if(isset($_GET['it']) && strpos($this->dirtyURL, '?it=') !== false || strpos($this->dirtyURL, '&it=')) { + if(isset($_GET['it']) && (strpos($this->dirtyURL, '?it=') !== false || strpos($this->dirtyURL, '&it='))) { // force to use path in request url rather than contents of 'it' var list($it,) = explode('?', $this->dirtyURL); $rootURL = $this->wire('config')->urls->root; @@ -344,7 +344,7 @@ class ProcessPageView extends Process { $indexRedirect = true; } else if(strpos($this->dirtyURL, 'index.php') !== false && strpos($it, 'index.php') === false) { // if request contains index.php and the $it string does not, make it redirect to correct version - $forceRedirect = true; + if(preg_match('!/index\.php$!', parse_url($this->dirtyURL, PHP_URL_PATH))) $forceRedirect = true; } $numParts = substr_count($it, '/');