mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-27 00:09:13 +01:00
Does a small check to see if the requested class exists, before attempting to load and instantiate.
This commit is contained in:
parent
a446455ca4
commit
03a0fdd1a6
@ -68,10 +68,19 @@
|
|||||||
|
|
||||||
if (!isset($GLOBALS['phpgw_info']['flags']['included_classes'][$classname]) ||
|
if (!isset($GLOBALS['phpgw_info']['flags']['included_classes'][$classname]) ||
|
||||||
!$GLOBALS['phpgw_info']['flags']['included_classes'][$classname])
|
!$GLOBALS['phpgw_info']['flags']['included_classes'][$classname])
|
||||||
|
{
|
||||||
|
if(@file_exists(PHPGW_INCLUDE_ROOT.'/'.$appname.'/inc/class.'.$classname.'.inc.php'))
|
||||||
{
|
{
|
||||||
include(PHPGW_INCLUDE_ROOT.'/'.$appname.'/inc/class.'.$classname.'.inc.php');
|
include(PHPGW_INCLUDE_ROOT.'/'.$appname.'/inc/class.'.$classname.'.inc.php');
|
||||||
$GLOBALS['phpgw_info']['flags']['included_classes'][$classname] = True;
|
$GLOBALS['phpgw_info']['flags']['included_classes'][$classname] = True;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$GLOBALS['phpgw_info']['flags']['included_classes'][$classname] = False;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if($GLOBALS['phpgw_info']['flags']['included_classes'][$classname])
|
||||||
|
{
|
||||||
if ($p1 == '_UNDEF_' && $p1 != 1)
|
if ($p1 == '_UNDEF_' && $p1 != 1)
|
||||||
{
|
{
|
||||||
eval('$obj = new ' . $classname . ';');
|
eval('$obj = new ' . $classname . ';');
|
||||||
@ -99,6 +108,7 @@
|
|||||||
/* error_reporting(E_ERROR | E_WARNING | E_PARSE); */
|
/* error_reporting(E_ERROR | E_WARNING | E_PARSE); */
|
||||||
return $obj;
|
return $obj;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@function ExecObject
|
@function ExecObject
|
||||||
|
Loading…
Reference in New Issue
Block a user