Source
info(_s('Incorrect value "%1$s" for "%2$s" field: must be between %3$s and %4$s, and have no more than %5$s digits after the decimal point.',
<?php
/*
** Zabbix
** Copyright (C) 2001-2023 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
function unset_request($key) {
unset($_GET[$key], $_POST[$key], $_REQUEST[$key]);
}
/**
* Validation expression for min/max number range.
*
* @param int $min
* @param int $max
* @param string $var
*
* @return string
*/
function BETWEEN($min, $max, $var = '') {
return '({'.$var.'}>='.$min.'&&{'.$var.'}<='.$max.')&&';
}
/**
* Validation expression for min/max range and max number of digits after the decimal point.
*
* @param int $min
* @param int $max
* @param int $scale
* @param string $var
*
* @return string
*/
function BETWEEN_DBL($min, $max, $scale, $var = '') {
return BETWEEN($min, $max, $var).'(round({'.$var.'},'.$scale.')=={'.$var.'})&&';
}
function IN($array, $var = '') {
if (is_array($array)) {
$array = implode(',', $array);
}
return 'str_in_array({'.$var.'},array('.$array.'))&&';
}
/**
* @deprecated
*/