1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-14 10:45:54 +02:00

Fix issue processwire/processwire-issues#488 where UTF-8 mode urlSegments that contained only ascii would get converted to lowercase

This commit is contained in:
Ryan Cramer
2018-02-08 08:51:33 -05:00
parent 3ade2c3269
commit 6dbb244654

View File

@@ -289,12 +289,14 @@ class WireInput extends Wire {
$urlSegments[++$n] = $v;
}
$this->urlSegments = $urlSegments;
} else if($this->wire('config')->pageNameCharset == 'UTF8') {
// set UTF8
$this->urlSegments[$num] = $this->wire('sanitizer')->pageNameUTF8($value, $maxLength);
} else {
// set ascii
$this->urlSegments[$num] = $this->wire('sanitizer')->name($value, false, $maxLength);
// sanitize to standard PW name format
$urlSegment = $this->wire('sanitizer')->name($value, false, $maxLength);
// if UTF-8 mode and value changed during name sanitization, try pageNameUTF8 instead
if($urlSegment !== $value && $this->wire('config')->pageNameCharset == 'UTF8') {
$urlSegment = $this->wire('sanitizer')->pageNameUTF8($value, $maxLength);
}
$this->urlSegments[$num] = $urlSegment;
}
}