]> 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 Haeder <roland@mxchange.org>
Tue, 16 Sep 2014 17:13:21 +0000 (19:13 +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 a64bea79e6221984f6e2be5007237a99272b6d34..46e160562ac922f1f83f366195bc6fdde97378ad 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) {