From 28a819926c1fa711a3b137a45dd385d97371c91b Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 1 Apr 2014 10:37:36 +0000 Subject: [PATCH] fixed fatal error class Horde_String not found when trying to save a new compose with attached vCard as draft caused be previous include include of phpgwapi/inc/horde/Horde/String.php via use of vCard and old Horde code uses just String instead of Horde_String as class-name --- phpgwapi/inc/common_functions.inc.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/phpgwapi/inc/common_functions.inc.php b/phpgwapi/inc/common_functions.inc.php index 337e9bcd5a..d376dfeac9 100755 --- a/phpgwapi/inc/common_functions.inc.php +++ b/phpgwapi/inc/common_functions.inc.php @@ -1486,10 +1486,12 @@ function __autoload($class) // eGW eTemplate classes using the old naming schema, eg. etemplate file_exists($file = EGW_INCLUDE_ROOT.'/etemplate/inc/class.'.$class.'.inc.php') || // include PEAR and PSR0 classes from include_path - !isset($GLOBALS['egw_info']['apps'][$app]) && @include_once($file = strtr($class, array('_'=>'/','\\'=>'/')).'.php')) + // need to use include (not include_once) as eg. a previous included EGW_API_INC/horde/Horde/String.php causes + // include_once('Horde/String.php') to return true, even if the former was included with an absolute path + !isset($GLOBALS['egw_info']['apps'][$app]) && @include($file = strtr($class, array('_'=>'/','\\'=>'/')).'.php')) { - //error_log("autoloaded class $class from $file"); include_once($file); + //error_log("autoloading class $class by include_once($file)"); } // allow apps to define an own autoload method elseif (isset($GLOBALS['egw_info']['flags']['autoload']) && is_callable($GLOBALS['egw_info']['flags']['autoload']))