Be less restrictive on what characters are disallowed in custom slugs

This commit is contained in:
Alejandro Celaya
2024-12-17 18:00:02 +01:00
parent d533adf7ce
commit e80af78e09
3 changed files with 9 additions and 7 deletions

View File

@@ -46,10 +46,10 @@ class CustomSlugValidator extends AbstractValidator
return false;
}
// URL reserved characters: https://datatracker.ietf.org/doc/html/rfc3986#section-2.2
$reservedChars = "!*'();:@&=+$,?%#[]";
// URL gen-delimiter reserved characters, except `/`: https://datatracker.ietf.org/doc/html/rfc3986#section-2.2
$reservedChars = ':?#[]@';
if (! $this->options->multiSegmentSlugsEnabled) {
// Slashes should be allowed for multi-segment slugs
// Slashes should only be allowed if multi-segment slugs are enabled
$reservedChars .= '/';
}