mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-06 23:33:13 +08:00
Ensured bars are replaced by dashes in custom slugs
This commit is contained in:
@@ -77,7 +77,7 @@ class ShortUrlInputFilter extends InputFilter
|
||||
// empty, is by using the deprecated setContinueIfEmpty
|
||||
$customSlug = $this->createInput(self::CUSTOM_SLUG, false)->setContinueIfEmpty(true);
|
||||
$customSlug->getFilterChain()->attach(new Filter\Callback(
|
||||
static fn (mixed $value) => is_string($value) ? str_replace([' ', '/'], ['-', ''], $value) : $value,
|
||||
static fn (mixed $value) => is_string($value) ? str_replace([' ', '/'], '-', $value) : $value,
|
||||
));
|
||||
$customSlug->getValidatorChain()->attach(new Validator\NotEmpty([
|
||||
Validator\NotEmpty::STRING,
|
||||
|
||||
Reference in New Issue
Block a user