diff --git a/module/Core/src/ShortUrl/Model/Validation/CustomSlugFilter.php b/module/Core/src/ShortUrl/Model/Validation/CustomSlugFilter.php index 8355a003..ec0b30d3 100644 --- a/module/Core/src/ShortUrl/Model/Validation/CustomSlugFilter.php +++ b/module/Core/src/ShortUrl/Model/Validation/CustomSlugFilter.php @@ -25,10 +25,9 @@ class CustomSlugFilter implements FilterInterface } $value = $this->options->isLooselyMode() ? strtolower($value) : $value; - if ($this->options->multiSegmentSlugsEnabled) { - return trim(str_replace(' ', '-', $value), '/'); - } - - return str_replace([' ', '/'], '-', $value); + return (match ($this->options->multiSegmentSlugsEnabled) { + true => trim(str_replace(' ', '-', $value), '/'), + false => str_replace([' ', '/'], '-', $value), + }); } }