]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Reoved another to strict type-hint + added check if $args is no array. In this
authorRoland Haeder <roland@mxchange.org>
Tue, 16 Sep 2014 17:13:21 +0000 (19:13 +0200)
committerRoland Häder <roland@mxchange.org>
Sun, 29 Mar 2020 22:20:29 +0000 (00:20 +0200)
case the below foreach() is unneccessary as the if() block in it will never
match.

Signed-off-by: Roland Haeder <roland@mxchange.org>
lib/menu.php

index 087666617dd423fa95223df411f1e3a2bdce08d5..d9da2418b4a9e3d821ccc96aab3232c2bc516fd9 100644 (file)
@@ -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) {