Skip to content

Commit

Permalink
fix possible wrong index access
Browse files Browse the repository at this point in the history
  • Loading branch information
tombrain committed Nov 5, 2023
1 parent 498ef2a commit ef5d6e2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/fields/class.DateTextField.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,10 @@ public function getAsArray()
return array("", "", "");
}
if (preg_match($this->_sValParseRegExpr, $this->getValue(), $data) == 0)
{
trigger_error("Value is not a valid date [" . $this->getValue() . "]", E_USER_ERROR);
return null;
}
if ($data[$this->_iYearPos] <= 50)
$data[$this->_iYearPos] = $data[$this->_iYearPos] + 2000;
if ($data[$this->_iYearPos] <= 100)
Expand Down

0 comments on commit ef5d6e2

Please sign in to comment.