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
This commit is contained in:
Ralf Becker 2014-04-01 10:37:36 +00:00
parent dd150cbf44
commit 28a819926c

View File

@ -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']))