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>
2022.09-rc
Roland Häder 2018-07-18 21:41:24 +02:00 zatwierdzone przez Hypolite Petovan
rodzic b057906bed
commit 2c44437d40
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

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