mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
Avoid passing non-string args to ctype_*()
functions
This commit is contained in:
parent
2712275c45
commit
420dfcbdbf
@ -8,11 +8,11 @@ class FilterInt implements ValueFilter
|
|||||||
{
|
{
|
||||||
public function filter($value)
|
public function filter($value)
|
||||||
{
|
{
|
||||||
if ($value === '') {
|
if ($value === '' || $value === null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! ctype_digit($value)) {
|
if (is_string($value) && ! ctype_digit($value)) {
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -473,7 +473,7 @@ abstract class QuickTable implements Paginatable, ValidHtml
|
|||||||
protected function valueToTimestamp($value)
|
protected function valueToTimestamp($value)
|
||||||
{
|
{
|
||||||
// We consider integers as valid timestamps. Does not work for URL params
|
// We consider integers as valid timestamps. Does not work for URL params
|
||||||
if (ctype_digit($value)) {
|
if (! is_string($value) || ctype_digit($value)) {
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
$value = strtotime($value);
|
$value = strtotime($value);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user