@@ -569,7 +569,7 @@ private function getAttributeValue($attributeId, $valueIds, $storeId)
569
569
if (false !== $ value ) {
570
570
$ optionValue = $ this ->getAttributeOptionValue ($ attributeId , $ valueIds , $ storeId );
571
571
if (null === $ optionValue ) {
572
- $ value = $ value !== null ? $ this ->filterAttributeValue ($ value ) : '' ;
572
+ $ value = $ this ->filterAttributeValue ($ value );
573
573
} else {
574
574
$ value = implode ($ this ->separator , array_filter ([$ value , $ optionValue ]));
575
575
}
@@ -605,7 +605,7 @@ private function getAttributeOptionValue($attributeId, $valueIds, $storeId)
605
605
$ this ->attributeOptions [$ optionKey ] = array_column ($ options , 'label ' , 'value ' );
606
606
$ this ->attributeOptions [$ optionKey ] = array_map (
607
607
function ($ value ) {
608
- return $ value !== null ? $ this ->filterAttributeValue ($ value ) : '' ;
608
+ return $ this ->filterAttributeValue ($ value );
609
609
},
610
610
$ this ->attributeOptions [$ optionKey ]
611
611
);
@@ -625,11 +625,11 @@ function ($value) {
625
625
/**
626
626
* Remove whitespaces and tags from attribute value
627
627
*
628
- * @param string $value
628
+ * @param string|null $value
629
629
* @return string
630
630
*/
631
- private function filterAttributeValue (string $ value )
631
+ private function filterAttributeValue (? string $ value )
632
632
{
633
- return preg_replace ('/\s+/iu ' , ' ' , trim (strip_tags ($ value )));
633
+ return $ value !== null ? preg_replace ('/\s+/iu ' , ' ' , trim (strip_tags ($ value ))) : '' ;
634
634
}
635
635
}
0 commit comments