Skip to content
Snippets Groups Projects
Commit de18d159 authored by Regis Houssin's avatar Regis Houssin
Browse files

Fix: bad value in eregi function

parent 872a91d4
Branches
Tags
No related merge requests found
......@@ -409,15 +409,7 @@ class Menubase
$perms = $this->verifCond($menu['perms']);
//print "verifCond rowid=".$menu['rowid']." ".$menu['right'].":".$perms."<br>\n";
}
/*
// Define $constraint
$constraint = true;
if ($menu['action'])
{
$constraint = $this->verifCond($menu['action']);
//print "verifCond rowid=".$menu['rowid']." ".$menu['action'].":".$constraint."<br>\n";
}
*/
// Define $enabled
$enabled = true;
if ($menu['enabled'])
......@@ -432,7 +424,7 @@ class Menubase
$tabMenu[$b][0] = $menu['rowid'];
$tabMenu[$b][1] = $menu['fk_menu'];
$tabMenu[$b][2] = $menu['url'];
if (! eregi($tabMenu[$b][2],"^(http:\/\/|https:\/\/)"))
if (! eregi("^(http:\/\/|https:\/\/)",$tabMenu[$b][2]))
{
if (eregi('\?',$tabMenu[$b][2])) $tabMenu[$b][2].='&amp;idmenu='.$menu['rowid'];
else $tabMenu[$b][2].='?idmenu='.$menu['rowid'];
......@@ -442,8 +434,6 @@ class Menubase
$tabMenu[$b][6] = $menu['leftmenu'];
if (! isset($tabMenu[$b][4])) $tabMenu[$b][4] = $perms;
else $tabMenu[$b][4] = ($tabMenu[$b][4] && $perms);
//if (! isset($tabMenu[$b][7])) $tabMenu[$b][7] = $constraint;
//else $tabMenu[$b][7] = ($tabMenu[$b][7] && $constraint);
if (! isset($tabMenu[$b][7])) $tabMenu[$b][7] = $enabled;
else $tabMenu[$b][7] = ($tabMenu[$b][7] && $enabled);
......@@ -510,7 +500,7 @@ class Menubase
{
// print "x".$pere." ".$tab[$x][6];
$this->newmenu->add((! eregi($tab[$x][2],"^(http:\/\/|https:\/\/)")) ? DOL_URL_ROOT . $tab[$x][2] : $tab[$x][2], $tab[$x][3], $rang -1, $tab[$x][4], $tab[$x][5]);
$this->newmenu->add((! eregi("^(http:\/\/|https:\/\/)",$tab[$x][2])) ? DOL_URL_ROOT . $tab[$x][2] : $tab[$x][2], $tab[$x][3], $rang -1, $tab[$x][4], $tab[$x][5]);
$this->recur($tab, $tab[$x][0], $rang +1);
}
}
......@@ -672,8 +662,6 @@ class Menubase
$tabMenu[$b]['atarget'] = $objm->target;
if (! isset($tabMenu[$b]['right'])) $tabMenu[$b]['right'] = $perms;
else $tabMenu[$b]['right'] = ($tabMenu[$b]['right'] && $perms);
//if (! isset($tabMenu[$b]['enabled'])) $tabMenu[$b]['enabled'] = $constraint;
//else $tabMenu[$b]['enabled'] = ($tabMenu[$b]['enabled'] && $constraint);
if (! isset($tabMenu[$b]['enabled'])) $tabMenu[$b]['enabled'] = $enabled;
else $tabMenu[$b]['enabled'] = ($tabMenu[$b]['enabled'] && $enabled);
......
......@@ -80,7 +80,7 @@ class MenuTop {
if ($tabMenu[$i]['right'] == true) // Is allowed
{
// Define url
if (eregi($tabMenu[$i]['url'],"^(http:\/\/|https:\/\/)"))
if (eregi("^(http:\/\/|https:\/\/)",$tabMenu[$i]['url']))
{
$url = $tabMenu[$i]['url'];
}
......
......@@ -80,7 +80,7 @@ class MenuTop {
if ($tabMenu[$i]['right'] == true) // Is allowed
{
// Define url
if (eregi($tabMenu[$i]['url'],"^(http:\/\/|https:\/\/)"))
if (eregi("^(http:\/\/|https:\/\/)",$tabMenu[$i]['url']))
{
$url = $tabMenu[$i]['url'];
}
......
......@@ -416,7 +416,7 @@ class MenuTop {
$idsel=(empty($tabMenu[$i]['mainmenu'])?'none':$tabMenu[$i]['mainmenu']);
if ($tabMenu[$i]['right'] == true) // Is allowed
{
if (eregi($tabMenu[$i]['url'],"^(http:\/\/|https:\/\/)"))
if (eregi("^(http:\/\/|https:\/\/)",$tabMenu[$i]['url']))
{
$url = $tabMenu[$i]['url'];
}
......
......@@ -415,7 +415,7 @@ class MenuTop {
$idsel=(empty($tabMenu[$i]['mainmenu'])?'none':$tabMenu[$i]['mainmenu']);
if ($tabMenu[$i]['right'] == true) // Is allowed
{
if (eregi($tabMenu[$i]['url'],"^(http:\/\/|https:\/\/)"))
if (eregi("^(http:\/\/|https:\/\/)",$tabMenu[$i]['url']))
{
$url = $tabMenu[$i]['url'];
}
......
......@@ -358,7 +358,7 @@ class MenuTop {
$idsel=(empty($tabMenu[$i]['mainmenu'])?'id="none" ':'id="'.$tabMenu[$i]['mainmenu'].'" ');
if ($tabMenu[$i]['right'] == true)
{
if (eregi($tabMenu[$i]['url'],"^(http:\/\/|https:\/\/)"))
if (eregi("^(http:\/\/|https:\/\/)",$tabMenu[$i]['url']))
{
$url = $tabMenu[$i]['url'];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment