"fixed bug reported by matsie(at)terra.es: fatal error on ical export in calendar:

was cased by browser/inc/class.browser.inc.php having top priority in autoloading, which was never intended"
This commit is contained in:
Ralf Becker 2008-05-06 05:57:21 +00:00
parent f6a883713f
commit 3a5b24dfda

View File

@ -1,32 +1,18 @@
<?php
/**************************************************************************\
* eGroupWare API - commonly used functions included by eGW AND setup *
* The file was originaly written by Dan Kuykendall <seek3r@phpgroupware.org> *
* and Joseph Engo <jengo@phpgroupware.org> *
* Copyright (C) 2000, 2001 Dan Kuykendall *
* -------------------------------------------------------------------------*
* This library is part of the eGroupWare API *
* http://www.egroupware.org *
* ------------------------------------------------------------------------ *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by *
* the Free Software Foundation; either version 2.1 of the License, *
* or any later version. *
* This library is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU Lesser General Public License for more details. *
* You should have received a copy of the GNU Lesser General Public License *
* along with this library; if not, write to the Free Software Foundation, *
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
\**************************************************************************/
/* $Id$ */
/****************************************************************************\
* Direct functions which are not part of the API classes *
* because they are required to be available at the lowest level. *
\***************************************************************************/
/**
* eGroupWare commonly used functions
*
* This file was originaly written by Dan Kuykendall and Joseph Engo
* Copyright (C) 2000, 2001 Dan Kuykendall
*
* All newer parts (XSS checks, autoloading, exception handler, ...) are written by Ralf Becker.
*
* @link http://www.egroupware.org
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @package api
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$
*/
/**
* Return the number of bytes of a string, independent of mbstring.func_overload
@ -132,7 +118,6 @@
print_r($var);
if (DEBUG_DATATYPES)
{
// while(list($key, $value) = each($var))
foreach($var as $key => $value)
{
if (is_array($value))
@ -1350,13 +1335,13 @@ function __autoload($class)
$components = explode('_',$class);
$app = array_shift($components);
$baseclass = $components[0];
// classes using the new naming schema app_class_name, eg. admin_cmd
if (file_exists($file = EGW_INCLUDE_ROOT.'/'.$app.'/inc/class.'.$class.'.inc.php') ||
// classes using the new naming schema app_class_name, eg. admin_cmd, but not app/inc/class.app.inc.php
if ($app != $class && file_exists($file = EGW_INCLUDE_ROOT.'/'.$app.'/inc/class.'.$class.'.inc.php') ||
// classes using the new naming schema app_class_name, eg. admin_cmd
file_exists($file = EGW_INCLUDE_ROOT.'/'.$app.'/inc/class.'.$app.'_'.$baseclass.'.inc.php') ||
// eGW api classes using the old naming schema, eg. html
file_exists($file = EGW_API_INC.'/class.'.$class.'.inc.php') ||
// eGW api classes using the old naming schema, eg. html
// eGW api classes containing multiple classes in on file, eg. egw_exception
file_exists($file = EGW_API_INC.'/class.'.$app.'_'.$baseclass.'.inc.php') ||
// eGW eTemplate classes using the old naming schema, eg. etemplate
file_exists($file = EGW_INCLUDE_ROOT.'/etemplate/inc/class.'.$class.'.inc.php') ||
@ -1366,20 +1351,18 @@ function __autoload($class)
//error_log("autoloaded class $class from $file");
include_once($file);
}
else
elseif (is_array($GLOBALS['egw_info']['apps']))
{
if (is_array($GLOBALS['egw_info']['apps'])) {
foreach($GLOBALS['egw_info']['apps'] as $lapp => $appvalue)
foreach(array_keys($GLOBALS['egw_info']['apps']) as $app)
{
if (file_exists($file = EGW_INCLUDE_ROOT.'/'.$lapp.'/inc/class.'.$class.'.inc.php'))
if (file_exists($file = EGW_INCLUDE_ROOT.'/'.$app.'/inc/class.'.$class.'.inc.php'))
{
#echo "$lapp,$class<br>";
error_log("autoloaded class $class from $file");
include_once($file);
}
}
}
}
}
/**
* Fail a little bit more gracefully then an uncought exception