Fix bug reported by scrutinizer

This commit is contained in:
Laurent Destailleur 2018-10-21 12:14:20 +02:00
parent 868caa4991
commit 4e6b21881f
2 changed files with 4 additions and 3 deletions

View File

@ -468,16 +468,17 @@ function treeOutputForAbsoluteDir($sqltree, $selecteddir, $fullpathselecteddir,
{
//print 'modulepart='.$modulepart.' fullpathselecteddir='.$fullpathselecteddir.' - val[fullrelativename] (in database)='.$val['fullrelativename'].' - val[id]='.$val['id'].' - is_dir='.dol_is_dir($fullpathselecteddir . $file).' - file='.$file."\n";
$newselecteddir = $val['fullrelativename'];
$newfullpathselecteddir='';
if ($modulepart == 'ecm')
{
$newfullpathselecteddir=$conf->ecm->dir_output.'/'.($val['fullrelativename'] != '/' ? $val['fullrelativename'] : '');
}
if ($modulepart == 'medias')
elseif ($modulepart == 'medias')
{
$newfullpathselecteddir=$dolibarr_main_data_root.'/medias/'.($val['fullrelativename'] != '/' ? $val['fullrelativename'] : '');
}
treeOutputForAbsoluteDir($sqltree, $newselecteddir, $newfullpathselecteddir, $modulepart, $websitekey, $pageid, $preopened, $fullpathpreopened, $depth+1);
if ($newfullpathselecteddir) treeOutputForAbsoluteDir($sqltree, $newselecteddir, $newfullpathselecteddir, $modulepart, $websitekey, $pageid, $preopened, $fullpathpreopened, $depth+1);
}
print "</li>\n";

View File

@ -126,7 +126,7 @@ class Menubase
$this->perms=trim($this->perms);
$this->enabled=trim($this->enabled);
$this->user=trim($this->user);
$this->position=trim($this->position);
if (empty($this->position)) $this->position=0;
if (! $this->level) $this->level=0;
// Check parameters