From: Roland Haeder Date: Tue, 16 Sep 2014 17:13:21 +0000 (+0200) Subject: Reoved another to strict type-hint + added check if $args is no array. In this X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=89a4aab1785d86db1300790d325ea3dc379277b0;p=quix0rs-gnu-social.git Reoved another to strict type-hint + added check if $args is no array. In this case the below foreach() is unneccessary as the if() block in it will never match. Signed-off-by: Roland Haeder --- diff --git a/lib/menu.php b/lib/menu.php index 087666617d..d9da2418b4 100644 --- a/lib/menu.php +++ b/lib/menu.php @@ -124,10 +124,16 @@ class Menu extends Widget $cls); } - function isCurrent($actionName, array $args) + function isCurrent($actionName, $args) { if ($actionName != $this->actionName) { return false; + } elseif (!is_array($args)) { + /* + * No array, then the below loop doesn't need to run and + * 'return false' will never be reached. + */ + return true; } foreach ($this->actionArgs as $k => $v) {