diff --git a/src/Symfony/Component/HttpFoundation/ParameterBag.php b/src/Symfony/Component/HttpFoundation/ParameterBag.php index 84c0fb8055..43253de08f 100644 --- a/src/Symfony/Component/HttpFoundation/ParameterBag.php +++ b/src/Symfony/Component/HttpFoundation/ParameterBag.php @@ -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)); } /**