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:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user