summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/validate.inc.php
diff options
context:
space:
mode:
authorosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2006-05-30 10:47:49 +0000
committerosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2006-05-30 10:47:49 +0000
commit50fac1b045635cea584c45d5b518b0557cbe1869 (patch)
tree54a96ff522f4a8f6722e381767d7c4e4469ad0c4 /frontends/php/include/validate.inc.php
parentfcce006f76f5e93e675b9673bf3aec465e323d12 (diff)
downloadzabbix-50fac1b045635cea584c45d5b518b0557cbe1869.tar.gz
zabbix-50fac1b045635cea584c45d5b518b0557cbe1869.tar.xz
zabbix-50fac1b045635cea584c45d5b518b0557cbe1869.zip
- added whitespaces stripping (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@2920 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/validate.inc.php')
-rw-r--r--frontends/php/include/validate.inc.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/frontends/php/include/validate.inc.php b/frontends/php/include/validate.inc.php
index 4517c221..39581101 100644
--- a/frontends/php/include/validate.inc.php
+++ b/frontends/php/include/validate.inc.php
@@ -201,6 +201,21 @@
return ZBX_VALID_OK;
}
+ function check_trim(&$var)
+ {
+ if(is_string($var))
+ {
+ $var = trim($var);
+ }
+ elseif(is_array($var))
+ {
+ foreach($var as $key => $val)
+ {
+ check_trim($var[$key]);
+ }
+ }
+ }
+
function check_field(&$fields, &$field, $checks)
{
list($type,$opt,$flags,$validation,$exception)=$checks;
@@ -254,6 +269,8 @@
return ZBX_VALID_OK;
}
+ check_trim($_REQUEST[$field]);
+
$err = check_type($field, $flags, $_REQUEST[$field], $type);
if($err != ZBX_VALID_OK)
return $err;