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:
commit
5783f3b32d
|
@ -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
|
||||
) {
|
||||
|
|
Loading…
Reference in a new issue