Skip to content

Commit 41a74e1

Browse files
author
mcramer
committed
Fixed: Thrown php warning - added check if parameter is an array in validator
1 parent 753da50 commit 41a74e1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

interface/lib/classes/validate_datetime.inc.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ function _get_error($errmsg)
7474
*/
7575
function _get_timestamp_value($field_value)
7676
{
77-
$second = 0;
77+
if(!is_array($field_value)) return 0;
78+
$second = 0;
7879
$filtered_values = array_map(create_function('$item','return (int)$item;'), $field_value);
7980
extract($filtered_values, EXTR_OVERWRITE);
8081

@@ -93,6 +94,7 @@ function _get_timestamp_value($field_value)
9394
*/
9495
function not_empty($field_name, $field_value, $validator)
9596
{
97+
if(!is_array($field_value)) return $this->_get_error($validator['errmsg']);
9698
extract($field_value);
9799
if ( !($day > 0 && $month > 0 && $year > 0) ) {
98100
return $this->_get_error($validator['errmsg']);

0 commit comments

Comments
 (0)