Skip to content
This repository has been archived by the owner on Nov 26, 2017. It is now read-only.

Commit

Permalink
Remove some silencers
Browse files Browse the repository at this point in the history
  • Loading branch information
elkuku committed Jul 11, 2013
1 parent 8032df3 commit 200f4c2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Joomla/Filter/InputFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down Expand Up @@ -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':
Expand Down

0 comments on commit 200f4c2

Please sign in to comment.