Commit 41a74e15 authored by mcramer's avatar mcramer
Browse files

Fixed: Thrown php warning - added check if parameter is an array in validator

parent 753da508
......@@ -74,7 +74,8 @@ class validate_datetime
*/
function _get_timestamp_value($field_value)
{
$second = 0;
if(!is_array($field_value)) return 0;
$second = 0;
$filtered_values = array_map(create_function('$item','return (int)$item;'), $field_value);
extract($filtered_values, EXTR_OVERWRITE);
......@@ -93,6 +94,7 @@ class validate_datetime
*/
function not_empty($field_name, $field_value, $validator)
{
if(!is_array($field_value)) return $this->_get_error($validator['errmsg']);
extract($field_value);
if ( !($day > 0 && $month > 0 && $year > 0) ) {
return $this->_get_error($validator['errmsg']);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment