Improving performance on digit filtering
This commit is contained in:
parent
9356be3a1b
commit
4f8e8efe08
@ -229,7 +229,8 @@ class ParameterBag
|
||||
*/
|
||||
public function getDigits($key, $default = '', $deep = false)
|
||||
{
|
||||
return preg_replace('/[^[:digit:]]/', '', $this->get($key, $default, $deep));
|
||||
// we need to remove - and + because they're allowed in the filter
|
||||
return str_replace(array('-','+'),'', $this->filter($key, $default, $deep, FILTER_SANITIZE_NUMBER_INT));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user