remove old logging of bad menuaction, using error_log instead

old api logging class tries to instanciate Error class, which is a PHP own class/exception since some versions
This commit is contained in:
Ralf Becker 2021-04-06 11:04:30 +02:00
parent 197a6348a9
commit 8a0c0bc82e

View File

@ -102,7 +102,7 @@ if (isset($_GET['tz']))
// Check if we are using windows or normal webpage // Check if we are using windows or normal webpage
$windowed = false; $windowed = false;
$tpl_info = EGW_SERVER_ROOT . '/phpgwapi/templates/' . basename($GLOBALS['egw_info']['user']['preferences']['common']['template_set']) . '/setup/setup.inc.php'; $tpl_info = EGW_SERVER_ROOT . '/api/templates/' . basename($GLOBALS['egw_info']['user']['preferences']['common']['template_set']) . '/setup/setup.inc.php';
if (!file_exists($tpl_info)) if (!file_exists($tpl_info))
{ {
$tpl_info = EGW_SERVER_ROOT.'/'.basename($GLOBALS['egw_info']['user']['preferences']['common']['template_set']) . '/setup/setup.inc.php'; $tpl_info = EGW_SERVER_ROOT.'/'.basename($GLOBALS['egw_info']['user']['preferences']['common']['template_set']) . '/setup/setup.inc.php';
@ -171,32 +171,12 @@ else
{ {
if(!$app || !$class || !$method || $invalid_data) if(!$app || !$class || !$method || $invalid_data)
{ {
if(@is_object($GLOBALS['egw']->log)) error_log(__FILE__.": missing or bad menuaction '$_GET[menuaction]'!");
{
$GLOBALS['egw']->log->message(array(
'text' => 'W-BadmenuactionVariable, menuaction missing or corrupt: %1',
'p1' => $menuaction,
'line' => __LINE__,
'file' => __FILE__
));
}
} }
if(!is_array($GLOBALS[$class]->public_functions) || !$GLOBALS[$class]->public_functions[$method] && $method) if(!is_array($GLOBALS[$class]->public_functions) || !$GLOBALS[$class]->public_functions[$method] && $method)
{ {
if(@is_object($GLOBALS['egw']->log)) error_log(__FILE__.": invalid menuaction '$_GET[menuaction]', not in public_functions!");
{
$GLOBALS['egw']->log->message(array(
'text' => 'W-BadmenuactionVariable, attempted to access private method: %1',
'p1' => $method,
'line' => __LINE__,
'file' => __FILE__
));
}
}
if(@is_object($GLOBALS['egw']->log))
{
$GLOBALS['egw']->log->commit();
} }
$GLOBALS['egw']->redirect_link('/home/index.php'); $GLOBALS['egw']->redirect_link('/home/index.php');