From 3cfdebb46d9777bda04bdae3077d3d52f01d0d9a Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Tue, 16 Sep 2014 19:13:21 +0200 Subject: [PATCH] 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 --- lib/menu.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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) { -- 2.39.5