From 190d0cf7ac2cbc5b71637d4b07c712c0f5c4f4a3 Mon Sep 17 00:00:00 2001 From: hugetoad Date: Thu, 19 Jan 2006 15:04:05 +0000 Subject: Frontend improvements. git-svn-id: svn://svn.zabbix.com/trunk@2545 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- frontends/php/include/validate.inc.php | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'frontends/php/include') diff --git a/frontends/php/include/validate.inc.php b/frontends/php/include/validate.inc.php index 04ebac59..89090b51 100644 --- a/frontends/php/include/validate.inc.php +++ b/frontends/php/include/validate.inc.php @@ -19,6 +19,24 @@ **/ ?> =$min&&{}<=$max)&&"; + } + + function GT($value) + { + return "({}>=$value)&&"; + } + + function IN($array) + { + return "in_array({},array($array))&&"; + } + + define("NOT_EMPTY","({}!='')&&"); + +// VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION function calc_exp($fields,$field,$expression) { global $_REQUEST; @@ -67,7 +85,7 @@ if(($flags&P_ACT)&&(isset($_REQUEST[$field]))) { - info("Unset:".$field); +// info("Unset:".$field); unset($_REQUEST[$field]); } } @@ -189,6 +207,10 @@ else continue; } } + + if(isset($_REQUEST[$field])&&!get_magic_quotes_gpc()) { + $_REQUEST[$field]=addslashes($_REQUEST[$field]); + } } unset_not_in_list($fields); if($critical) @@ -199,7 +221,6 @@ } if(!$ret) { - info("zzz"); unset_action_vars($fields); } show_messages(); -- cgit