From 41a74e15e12f17774846091645748f5c408ae55f Mon Sep 17 00:00:00 2001
From: mcramer <m.cramer@pixcept.de>
Date: Wed, 12 Sep 2012 11:38:41 +0000
Subject: [PATCH] Fixed: Thrown php warning - added check if parameter is an
 array in validator

---
 interface/lib/classes/validate_datetime.inc.php | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/interface/lib/classes/validate_datetime.inc.php b/interface/lib/classes/validate_datetime.inc.php
index b13e0ac26..42afeaf5a 100755
--- a/interface/lib/classes/validate_datetime.inc.php
+++ b/interface/lib/classes/validate_datetime.inc.php
@@ -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']);
-- 
GitLab