@@ -569,7 +569,7 @@ private function getAttributeValue($attributeId, $valueIds, $storeId)
569569 if (false !== $ value ) {
570570 $ optionValue = $ this ->getAttributeOptionValue ($ attributeId , $ valueIds , $ storeId );
571571 if (null === $ optionValue ) {
572- $ value = $ value !== null ? $ this ->filterAttributeValue ($ value ) : '' ;
572+ $ value = $ this ->filterAttributeValue ($ value );
573573 } else {
574574 $ value = implode ($ this ->separator , array_filter ([$ value , $ optionValue ]));
575575 }
@@ -605,7 +605,7 @@ private function getAttributeOptionValue($attributeId, $valueIds, $storeId)
605605 $ this ->attributeOptions [$ optionKey ] = array_column ($ options , 'label ' , 'value ' );
606606 $ this ->attributeOptions [$ optionKey ] = array_map (
607607 function ($ value ) {
608- return $ value !== null ? $ this ->filterAttributeValue ($ value ) : '' ;
608+ return $ this ->filterAttributeValue ($ value );
609609 },
610610 $ this ->attributeOptions [$ optionKey ]
611611 );
@@ -625,11 +625,11 @@ function ($value) {
625625 /**
626626 * Remove whitespaces and tags from attribute value
627627 *
628- * @param string $value
628+ * @param string|null $value
629629 * @return string
630630 */
631- private function filterAttributeValue (string $ value )
631+ private function filterAttributeValue (? string $ value )
632632 {
633- return preg_replace ('/\s+/iu ' , ' ' , trim (strip_tags ($ value )));
633+ return $ value !== null ? preg_replace ('/\s+/iu ' , ' ' , trim (strip_tags ($ value ))) : '' ;
634634 }
635635}
0 commit comments