From 89a4aab1785d86db1300790d325ea3dc379277b0 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 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) { -- 2.39.5