Fixed E_NOTICE when no 'term' was provided (#5391)

* Fixed E_NOTICE when no 'term' was provided, maybe better encapsulate this whole
$_GET, $_POST and $_SESSION thing into a `Request` class?

Signed-off-by: Roland Häder <roland@mxchange.org>

* Rewrote to recommendation by @MrPetovan which results in really nicer code.

Signed-off-by: Roland Häder <roland@mxchange.org>
This commit is contained in:
Roland Häder 2018-07-18 21:41:24 +02:00 committed by Hypolite Petovan
parent b057906bed
commit 2c44437d40

View file

@ -15,7 +15,7 @@ function filer_content(App $a)
killme();
}
$term = unxmlify(trim($_GET['term']));
$term = unxmlify(trim(defaults($_GET, 'term', '')));
$item_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
logger('filer: tag ' . $term . ' item ' . $item_id);