Fix problem with 'empty' function and some PHP versions

This commit is contained in:
Olivier PEREZ 2015-04-11 17:23:37 +02:00
parent 6d1f0ada0e
commit faca65b510

View File

@ -89,11 +89,14 @@ class InputService {
* @return string|null
*/
private function returnIfNotBlank($filtered) {
if ($filtered && !empty(str_replace(' ', '', $filtered))) {
return $filtered;
} else {
return null;
if ($filtered) {
$withoutSpaces = str_replace(' ', '', $filtered);
if (!empty($withoutSpaces)) {
return $filtered;
}
}
return null;
}
}