Skip to content

Commit

Permalink
Type validation for navigation_shortcode()
Browse files Browse the repository at this point in the history
  • Loading branch information
Deltik committed Jan 18, 2020
1 parent 9506f98 commit 76c0f7e
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions e107_core/shortcodes/single/navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,29 @@ function navigation_shortcode($parm=null)
'alt6' => 6,
);


if(is_array($parm) && !empty($parm))
$category = 1;
$tmpl = 'main';
if (!is_array($parm))
{
$category = isset($types[$parm]) ? $types[$parm] : 1;
$tmpl = $parm ?: 'main';
}
elseif (!empty($parm))
{
$category = 1;
$tmpl = 'main';

if(!empty($parm['type']))
if (!empty($parm['type']))
{
$cat = $parm['type'];
$category = varset($types[$cat], 1);
}

if(!empty($parm['layout']))
if (!empty($parm['layout']))
{
$tmpl= $parm['layout'];
$tmpl = $parm['layout'];
}
}
else
{
$category = varset($types[$parm], 1);
$tmpl = vartrue($parm, 'main');
}

$nav = e107::getNav();

Expand Down

0 comments on commit 76c0f7e

Please sign in to comment.