Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'frontends/php/include/validate.inc.php')
-rw-r--r--frontends/php/include/validate.inc.php16
1 files changed, 7 insertions, 9 deletions
diff --git a/frontends/php/include/validate.inc.php b/frontends/php/include/validate.inc.php
index 47f42fcee8c..be78f66fe53 100644
--- a/frontends/php/include/validate.inc.php
+++ b/frontends/php/include/validate.inc.php
@@ -108,7 +108,7 @@ function validate_ip($str, &$arr) {
/**
* Validate IP mask. IP/bits.
- * bits range for IPv4: 16 - 32
+ * bits range for IPv4: 16 - 30
* bits range for IPv6: 112 - 128
*
* @param string $ip_range
@@ -125,7 +125,7 @@ function validate_ip_range_mask($ip_range) {
$bits = $parts[1];
if (validate_ipv4($ip, $arr)) {
- return preg_match('/^\d{1,2}$/', $bits) && $bits >= 16 && $bits <= 32;
+ return preg_match('/^\d{1,2}$/', $bits) && $bits >= 16 && $bits <= 30;
}
elseif (ZBX_HAVE_IPV6 && validate_ipv6($ip, $arr)) {
return preg_match('/^\d{1,3}$/', $bits) && $bits >= 112 && $bits <= 128;
@@ -183,7 +183,7 @@ function validate_ip_range_range($ip_range) {
function validate_ip_range($str) {
foreach (explode(',', $str) as $ip_range) {
- if (zbx_strpos($ip_range, '/') !== false) {
+ if (strpos($ip_range, '/') !== false) {
if (!validate_ip_range_mask($ip_range)) {
return false;
}
@@ -213,7 +213,7 @@ function validate_port_list($str) {
}
function calc_exp($fields, $field, $expression) {
- if (zbx_strstr($expression, '{}')) {
+ if (strpos($expression, '{}') !== false) {
if (!isset($_REQUEST[$field])) {
return false;
}
@@ -323,7 +323,7 @@ function check_type(&$field, $flags, &$var, $type, $caption = null) {
$decimalValidator = new CDecimalValidator(array(
'maxPrecision' => 16,
'maxScale' => 4,
- 'messageFormat' => _('Value "%2$s" of "%1$s" has incorrect decimal format.'),
+ 'messageInvalid' => _('Value "%2$s" of "%1$s" has incorrect decimal format.'),
'messagePrecision' => _(
'Value "%2$s" of "%1$s" is too long: it cannot have more than %3$s digits before the decimal point '.
'and more than %4$s digits after the decimal point.'
@@ -347,7 +347,7 @@ function check_type(&$field, $flags, &$var, $type, $caption = null) {
elseif ($type == T_ZBX_DBL_BIG) {
$decimalValidator = new CDecimalValidator(array(
'maxScale' => 4,
- 'messageFormat' => _('Value "%2$s" of "%1$s" has incorrect decimal format.'),
+ 'messageInvalid' => _('Value "%2$s" of "%1$s" has incorrect decimal format.'),
'messageScale' => _(
'Value "%2$s" of "%1$s" has too many digits after the decimal point: '.
'it cannot have more than %3$s digits.'
@@ -460,7 +460,7 @@ function check_field(&$fields, &$field, $checks) {
}
}
- if (!($flags & NO_TRIM)) {
+ if (!($flags & P_NO_TRIM)) {
check_trim($_REQUEST[$field]);
}
@@ -518,8 +518,6 @@ function check_fields(&$fields, $show_messages = true) {
'sid' => array(T_ZBX_STR, O_OPT, P_SYS, HEX(), null),
'triggers_hash' => array(T_ZBX_STR, O_OPT, P_SYS, NOT_EMPTY, null),
'print' => array(T_ZBX_INT, O_OPT, P_SYS, IN('1'), null),
- 'sort' => array(T_ZBX_STR, O_OPT, P_SYS, null, null),
- 'sortorder' => array(T_ZBX_STR, O_OPT, P_SYS, null, null),
'page' => array(T_ZBX_INT, O_OPT, P_SYS, null, null), // paging
'ddreset' => array(T_ZBX_INT, O_OPT, P_SYS, null, null)
);