Skip to content

Commit

Permalink
Fix bug reported by scrutinizer
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Oct 21, 2018
1 parent 868caa4 commit 4e6b218
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions htdocs/core/ajax/ajaxdirtree.php
Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/class/menubase.class.php
Expand Up @@ -126,7 +126,7 @@ function create($user=null)
$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
Expand Down

0 comments on commit 4e6b218

Please sign in to comment.