Skip to content

Commit

Permalink
Corrected file_exists check and little refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosgdf committed Jul 17, 2014
1 parent ad4512c commit bcafa2c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions htdocs/core/lib/functions.lib.php
Expand Up @@ -240,16 +240,17 @@ function dol_getprefix()
*/
function dol_include_once($relpath, $classname='')
{
$fullpath = dol_buildpath($relpath);

if (!file_exists($relpath)) {
if (!file_exists($fullpath)) {
dol_syslog('functions::dol_include_once Tried to load unexisting file: '.$relpath, LOG_ERR);
return false;
}

if (! empty($classname) && ! class_exists($classname)) {
return include dol_buildpath($relpath);
return include $fullpath;
} else {
return include_once dol_buildpath($relpath);
return include_once $fullpath;
}
}

Expand Down

0 comments on commit bcafa2c

Please sign in to comment.