summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/validate.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'frontends/php/include/validate.inc.php')
-rw-r--r--frontends/php/include/validate.inc.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/frontends/php/include/validate.inc.php b/frontends/php/include/validate.inc.php
index 39e9a66f..0e8ba889 100644
--- a/frontends/php/include/validate.inc.php
+++ b/frontends/php/include/validate.inc.php
@@ -19,7 +19,6 @@
**/
?>
<?php
-
function unset_request($key)
{
// SDI("unset: $key");
@@ -44,6 +43,10 @@
{
return "in_array({".$var."},array(".$array."))&&";
}
+ function HEX($var=NULL)
+ {
+ return "ereg(\"^[a-zA-Z0-9]{1,}$\",{".$var."})";
+ }
define("NOT_EMPTY","({}!='')&&");
define("DB_ID","({}>=0&&{}<=4294967295)&&");
@@ -279,13 +282,22 @@
return ZBX_VALID_OK;
}
+// VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION
+ $system_fields=array(
+ "sessionid"=> array(T_ZBX_STR, O_OPT, P_SYS, HEX(),NULL),
+ "triggers_hash"=> array(T_ZBX_STR, O_OPT, P_SYS, NOT_EMPTY,NULL)
+ );
+
function check_fields(&$fields)
{
global $_REQUEST;
+ global $system_fields;
$err = ZBX_VALID_OK;
+ $fields = array_merge($fields, $system_fields);
+
foreach($fields as $field => $checks)
{
$err |= check_field($fields, $field,$checks);