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=3cfdebb46d9777bda04bdae3077d3d52f01d0d9a;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 a64bea79e6..46e160562a 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) {