mirror of
https://github.com/processwire/processwire.git
synced 2025-08-11 09:14:58 +02:00
Fix issue in PagesPathFinder where it could return a 200 rather than 301 in some cases for multi-language URLs that were missing the leading language segment and 'verbose' mode was disabled.
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
* afterwards when appropriate.
|
* afterwards when appropriate.
|
||||||
* #pw-body
|
* #pw-body
|
||||||
*
|
*
|
||||||
* ProcessWire 3.x, Copyright 2022 by Ryan Cramer
|
* ProcessWire 3.x, Copyright 2024 by Ryan Cramer
|
||||||
* https://processwire.com
|
* https://processwire.com
|
||||||
*
|
*
|
||||||
* @todo:
|
* @todo:
|
||||||
@@ -131,9 +131,9 @@ class PagesPathFinder extends Wire {
|
|||||||
protected function init($path, array $options) {
|
protected function init($path, array $options) {
|
||||||
|
|
||||||
$this->options = array_merge($this->defaults, $options);
|
$this->options = array_merge($this->defaults, $options);
|
||||||
$this->verbose = $this->options['verbose'];
|
|
||||||
$this->methods = array();
|
$this->methods = array();
|
||||||
$this->useLanguages = $this->options['useLanguages'] ? $this->languages(true) : array();
|
$this->useLanguages = $this->options['useLanguages'] ? $this->languages(true) : array();
|
||||||
|
$this->verbose = $this->options['verbose'] || !empty($this->useLanguages);
|
||||||
$this->result = $this->getBlankResult(array('request' => $path));
|
$this->result = $this->getBlankResult(array('request' => $path));
|
||||||
$this->template = null;
|
$this->template = null;
|
||||||
$this->admin = null;
|
$this->admin = null;
|
||||||
@@ -934,7 +934,7 @@ class PagesPathFinder extends Wire {
|
|||||||
|
|
||||||
$result['methods'] = $this->methods;
|
$result['methods'] = $this->methods;
|
||||||
|
|
||||||
if(!$this->verbose) unset($result['parts'], $result['methods']);
|
if(!$this->options['verbose']) unset($result['parts'], $result['methods']);
|
||||||
|
|
||||||
if(empty($errors)) {
|
if(empty($errors)) {
|
||||||
// force errors placeholder to end if there aren’t any
|
// force errors placeholder to end if there aren’t any
|
||||||
|
Reference in New Issue
Block a user