From bcafa2c79060ef4ab9b893cb60d102949214f530 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Thu, 17 Jul 2014 21:44:59 +0200 Subject: [PATCH] Corrected file_exists check and little refactor --- htdocs/core/lib/functions.lib.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index eb2cc15de15..e91ee751727 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -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; } }