Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions wire/core/Sanitizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function __construct() {
* @param array $allowedExtras Additional characters that are allowed in the value
* @param string 1 character replacement value for invalid characters
* @param bool $beautify Whether to beautify the string, specify Sanitizer::translate to perform transliteration.
* @param int $maxLength
* @param mixed $maxLength Maximum length for input, false for no limit
* @return string
*
*/
Expand Down Expand Up @@ -90,7 +90,7 @@ public function nameFilter($value, array $allowedExtras, $replacementChar, $beau
$needsWork = strlen(str_replace($allowed, '', $value));
}

if(strlen($value) > $maxLength) $value = substr($value, 0, $maxLength);
if((ctype_digit($maxLength) || is_int($maxLength)) && strlen($value) > $maxLength) $value = substr($value, 0, $maxLength);

if($needsWork) {
$value = str_replace(array("'", '"'), '', $value); // blank out any quotes
Expand Down
2 changes: 1 addition & 1 deletion wire/core/WireInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ public function setUrlSegment($num, $value) {
$this->urlSegments = $urlSegments;
} else {
// set
$this->urlSegments[$num] = wire('sanitizer')->name($value);
$this->urlSegments[$num] = wire('sanitizer')->name($value,false,false);
}
}

Expand Down