Skip to content
Snippets Groups Projects
Commit ff894fd5 authored by franceslui's avatar franceslui Committed by Joël Pittet
Browse files

Issue #3311568 by franceslui: Function validateValue() of class...

Issue #3311568 by franceslui: Function validateValue() of class DateArgumentWrapper causes the warning "Trying to access array offset on value of type bool"
parent f67cc6aa
No related branches found
No related tags found
No related merge requests found
......@@ -236,6 +236,12 @@ class DateArgumentWrapper {
}
if ($this->getArgFormat() == 'oW') {
$info = $this->getYearWeek($value);
// If $info is not an array, $value should not be valid.
if (!is_array($info)) {
return FALSE;
}
// Find the max week for a year. Some years start a 53rd week.
$max_week = gmdate("W", strtotime("28 December {$info['year']}"));
return $info['week'] >= 1 && $info['week'] <= $max_week;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment