Skip to content

Commit 46caa5e

Browse files
committed
39525: Modified the code for leading 0 strings as === failing other cart rules conditions
1 parent 8521188 commit 46caa5e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/code/Magento/Rule/Model/Condition/AbstractCondition.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,10 @@ public function validateAttribute($validatedValue)
885885
protected function _compareValues($validatedValue, $value, $strict = true)
886886
{
887887
if ($strict && is_numeric($validatedValue) && is_numeric($value)) {
888-
return $validatedValue === $value;
888+
if (preg_match('/^0\d+$/', $validatedValue)) {
889+
return $validatedValue === $value;
890+
}
891+
return $validatedValue == $value;
889892
}
890893

891894
$validatePattern = preg_quote((string) $validatedValue, '~');

0 commit comments

Comments
 (0)