Use strict in_array() calls
This commit is contained in:
@ -20,7 +20,7 @@ class MD_STD_IN {
|
||||
*/
|
||||
final public static function sanitize_id($input):int {
|
||||
|
||||
$input = filter_var($input, FILTER_VALIDATE_INT, [
|
||||
$input = \filter_var($input, \FILTER_VALIDATE_INT, [
|
||||
'options' => [
|
||||
'min_range' => 1, // Minimum number of an ID generated.
|
||||
'max_range' => 4294967295 // Max value for MySQL's int data type
|
||||
@ -47,7 +47,7 @@ class MD_STD_IN {
|
||||
|
||||
if ($input === "") return 0;
|
||||
|
||||
$input = filter_var($input, FILTER_VALIDATE_INT, [
|
||||
$input = \filter_var($input, \FILTER_VALIDATE_INT, [
|
||||
'options' => [
|
||||
'min_range' => 0, // Minimum number of an ID generated.
|
||||
'max_range' => 4294967295 // Max value for MySQL's int data type
|
||||
@ -103,7 +103,7 @@ class MD_STD_IN {
|
||||
}
|
||||
else $output = self::sanitize_text($default);
|
||||
|
||||
if (!empty($allowed) and !in_array($output, $allowed)) {
|
||||
if (!empty($allowed) and !\in_array($output, $allowed, true)) {
|
||||
Throw new MDpageParameterNotFromListException("Parameter `{$var_name}` must be any of the allowed values: " . implode(', ', $allowed));
|
||||
}
|
||||
|
||||
@ -128,7 +128,7 @@ class MD_STD_IN {
|
||||
}
|
||||
else $output = self::sanitize_text($default);
|
||||
|
||||
if (!empty($allowed) and !in_array($output, $allowed)) {
|
||||
if (!empty($allowed) and !\in_array($output, $allowed, true)) {
|
||||
Throw new MDpageParameterNotFromListException("Parameter `{$var_name}` must be any of the allowed values: " . implode(', ', $allowed));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user