File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
app/code/core/Mage/Sales/Model/Quote Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -516,12 +516,16 @@ public function compare($item)
516516 // dispose of some options params, that can cramp comparing of arrays
517517 if (is_string ($ itemOptionValue ) && is_string ($ optionValue )) {
518518 try {
519- /** @var Unserialize_Parser $parser */
519+ /**
520+ * @var Mage_Core_Helper_UnserializeArray $parser
521+ * @var Mage_Core_Helper_String $stringHelper
522+ */
520523 $ parser = Mage::helper ('core/unserializeArray ' );
524+ $ stringHelper = Mage::helper ('core/string ' );
521525
522- $ _itemOptionValue =
523- is_numeric ($ itemOptionValue ) ? $ itemOptionValue : $ parser ->unserialize ($ itemOptionValue );
524- $ _optionValue = is_numeric ($ optionValue ) ? $ optionValue : $ parser ->unserialize ($ optionValue );
526+ // only ever try to unserialize, if it looks like a serialized array
527+ $ _itemOptionValue = $ stringHelper -> isSerializedArrayOrObject ($ itemOptionValue ) ? $ parser ->unserialize ($ itemOptionValue ) : $ itemOptionValue ;
528+ $ _optionValue = $ stringHelper -> isSerializedArrayOrObject ($ optionValue ) ? $ parser ->unserialize ($ optionValue ) : $ optionValue ;
525529
526530 if (is_array ($ _itemOptionValue ) && is_array ($ _optionValue )) {
527531 $ itemOptionValue = $ _itemOptionValue ;
You can’t perform that action at this time.
0 commit comments