Merge pull request #2877 from annando/1610-database-loop

Prevent a memory Access Violation when the database isn't connected
This commit is contained in:
rabuzarus 2016-10-28 11:21:01 +02:00 committed by GitHub
commit 5783f3b32d
1 changed files with 10 additions and 5 deletions

View File

@ -703,15 +703,20 @@ function logger($msg, $level = 0) {
global $db;
global $LOGGER_LEVELS;
$debugging = get_config('system','debugging');
$logfile = get_config('system','logfile');
$loglevel = intval(get_config('system','loglevel'));
// turn off logger in install mode
if (
$a->module == 'install'
|| ! ($db && $db->connected)
|| ! $debugging
) {
return;
}
$debugging = get_config('system','debugging');
$logfile = get_config('system','logfile');
$loglevel = intval(get_config('system','loglevel'));
if (
! $debugging
|| ! $logfile
|| $level > $loglevel
) {