1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-10 00:37:02 +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:
Ryan Cramer
2024-02-21 09:31:59 -05:00
parent b5d8a91e49
commit c6dc986f9c

View File

@@ -15,7 +15,7 @@
* afterwards when appropriate.
* #pw-body
*
* ProcessWire 3.x, Copyright 2022 by Ryan Cramer
* ProcessWire 3.x, Copyright 2024 by Ryan Cramer
* https://processwire.com
*
* @todo:
@@ -131,9 +131,9 @@ class PagesPathFinder extends Wire {
protected function init($path, array $options) {
$this->options = array_merge($this->defaults, $options);
$this->verbose = $this->options['verbose'];
$this->methods = 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->template = null;
$this->admin = null;
@@ -934,7 +934,7 @@ class PagesPathFinder extends Wire {
$result['methods'] = $this->methods;
if(!$this->verbose) unset($result['parts'], $result['methods']);
if(!$this->options['verbose']) unset($result['parts'], $result['methods']);
if(empty($errors)) {
// force errors placeholder to end if there arent any