PHP-Error in mod_mj_menu, helper.php line 38

HugoMontenegro
13 years, 7 months ago
On my site i got an error in this line:
foreach($items as $key=>$item)
since one can't be sure, that $items is an array.
I made a workaround like this (not nice code - it's a quickfix):

if(is_array($items))
{
foreach($items as $key=>$item)
for($i=0, $count=count($attributes); $i<$count; $i++)
if($item->$attributes[$i] != $values[$i])
{
unset($items[$key]);
break;
}
}
else
{
for($i=0, $count=count($attributes); $i<$count; $i++)
if($item->$attributes[$i] != $values[$i])
{
unset($items[$key]);
break;
}
}

By continuing to use this site you consent to the use of cookies on your device as described in our cookie policy unless you have disabled them. This site will not function correctly without cookies.

I accept cookies from this site.