filter null param

This commit is contained in:
Fred Tempez 2022-10-05 10:35:36 +02:00
parent 672e4dc453
commit 34ddb487cd

View File

@ -333,7 +333,7 @@ class helper {
* @return string * @return string
*/ */
public static function filter($text, $filter) { public static function filter($text, $filter) {
$text = trim($text); $text = is_null($text) ? $text : trim($text);
switch($filter) { switch($filter) {
case self::FILTER_BOOLEAN: case self::FILTER_BOOLEAN:
$text = (bool) $text; $text = (bool) $text;