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)
|
||||
{
|
||||
if ($value === '') {
|
||||
if ($value === '' || $value === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (! ctype_digit($value)) {
|
||||
if (is_string($value) && ! ctype_digit($value)) {
|
||||
return $value;
|
||||
}
|
||||
|
||||
|
|
|
@ -473,7 +473,7 @@ abstract class QuickTable implements Paginatable, ValidHtml
|
|||
protected function valueToTimestamp($value)
|
||||
{
|
||||
// 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;
|
||||
}
|
||||
$value = strtotime($value);
|
||||
|
|
Loading…
Reference in New Issue