[OPTIMISATION] Optimized get method in Input class to trim value and return default value if empty.

This commit is contained in:
Simon Sessingø
2016-04-16 21:34:22 +02:00
parent 2afe784f47
commit eb3ddf2bf7
+1 -1
View File
@@ -89,7 +89,7 @@ class Input {
return ($key !== null && isset($item->getValue()[$key])) ? $item->getValue()[$key] : $item->getValue();
}
return ($item->getValue() === null) ? $default : $item->getValue();
return (trim($item->getValue()) === '') ? $default : $item->getValue();
}
return $default;