Skip to content

Commit ada44c2

Browse files
committed
ACP2E-347 - accept and validate negative timestamps generated for years before 1970
1 parent 8e27217 commit ada44c2

File tree

1 file changed

+1
-1
lines changed
  • lib/internal/Magento/Framework/Data/Form/Element

1 file changed

+1
-1
lines changed

lib/internal/Magento/Framework/Data/Form/Element/Date.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public function setValue($value)
9999
return $this;
100100
}
101101
try {
102-
if (preg_match('/^[\-0-9]+$/', $value)) {
102+
if (preg_match('/^[\-]{0,1}[0-9]+$/', $value)) {
103103
$this->_value = (new \DateTime())->setTimestamp($this->_toTimestamp($value));
104104
} elseif (is_string($value) && $this->isDate($value)) {
105105
$this->_value = new \DateTime($value, new \DateTimeZone($this->localeDate->getConfigTimezone()));

0 commit comments

Comments
 (0)