From ec6342588d7d3c1b8dfd3cc21246fbf7067ba248 Mon Sep 17 00:00:00 2001 From: Albert Mueller <2986829+albertmueller@users.noreply.github.com> Date: Wed, 4 Nov 2020 08:06:29 +0100 Subject: [PATCH] fix return empty string if $string is null --- .../Pimcore/DataObject/AbstractSluggableLinkGenerator.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/CoreShop/Component/Pimcore/DataObject/AbstractSluggableLinkGenerator.php b/src/CoreShop/Component/Pimcore/DataObject/AbstractSluggableLinkGenerator.php index 480fe5e6f4..6d02a8343f 100644 --- a/src/CoreShop/Component/Pimcore/DataObject/AbstractSluggableLinkGenerator.php +++ b/src/CoreShop/Component/Pimcore/DataObject/AbstractSluggableLinkGenerator.php @@ -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(