Skip to content

Commit

Permalink
Merge pull request #1518 from dgtls/issue/2.2-1498
Browse files Browse the repository at this point in the history
fix return empty string if $string is null
  • Loading branch information
dpfaffenbauer authored Nov 4, 2020
2 parents 9fc16d5 + ec63425 commit 4b70c93
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ abstract class AbstractSluggableLinkGenerator implements LinkGeneratorInterface
{
protected function slugify($string)
{
if ($string === null) {
return '';
}

return strtolower(
trim(
preg_replace('~[^0-9a-z]+~i', '-', html_entity_decode(
Expand Down

0 comments on commit 4b70c93

Please sign in to comment.