From 200f4c20d8992146fd568f0771aff1dce7ab29ae Mon Sep 17 00:00:00 2001 From: Nikolai Plath Date: Wed, 10 Jul 2013 21:57:18 -0500 Subject: [PATCH] Remove some silencers --- src/Joomla/Filter/InputFilter.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Joomla/Filter/InputFilter.php b/src/Joomla/Filter/InputFilter.php index 6d250c779..5d2253123 100644 --- a/src/Joomla/Filter/InputFilter.php +++ b/src/Joomla/Filter/InputFilter.php @@ -172,20 +172,20 @@ public function clean($source, $type = 'string') case 'INTEGER': // Only use the first integer value preg_match('/-?[0-9]+/', (string) $source, $matches); - $result = @ (int) $matches[0]; + $result = isset($matches[0]) ? (int) $matches[0] : null; break; case 'UINT': // Only use the first integer value preg_match('/-?[0-9]+/', (string) $source, $matches); - $result = @ abs((int) $matches[0]); + $result = isset($matches[0]) ? abs((int) $matches[0]) : null; break; case 'FLOAT': case 'DOUBLE': // Only use the first floating point value preg_match('/-?[0-9]+(\.[0-9]+)?/', (string) $source, $matches); - $result = @ (float) $matches[0]; + $result = isset($matches[0]) ? (float) $matches[0] : null; break; case 'BOOL': @@ -225,7 +225,7 @@ public function clean($source, $type = 'string') case 'PATH': $pattern = '/^[A-Za-z0-9_-]+[A-Za-z0-9_\.-]*([\\\\\/][A-Za-z0-9_-]+[A-Za-z0-9_\.-]*)*$/'; preg_match($pattern, (string) $source, $matches); - $result = @ (string) $matches[0]; + $result = isset($matches[0]) ? (string) $matches[0] : null; break; case 'USERNAME':