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
1 changed files with 10 additions and 5 deletions
|
@ -703,15 +703,20 @@ function logger($msg, $level = 0) {
|
||||||
global $db;
|
global $db;
|
||||||
global $LOGGER_LEVELS;
|
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
|
// turn off logger in install mode
|
||||||
if (
|
if (
|
||||||
$a->module == 'install'
|
$a->module == 'install'
|
||||||
|| ! ($db && $db->connected)
|
|| ! ($db && $db->connected)
|
||||||
|| ! $debugging
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$debugging = get_config('system','debugging');
|
||||||
|
$logfile = get_config('system','logfile');
|
||||||
|
$loglevel = intval(get_config('system','loglevel'));
|
||||||
|
|
||||||
|
if (
|
||||||
|
! $debugging
|
||||||
|| ! $logfile
|
|| ! $logfile
|
||||||
|| $level > $loglevel
|
|| $level > $loglevel
|
||||||
) {
|
) {
|
||||||
|
|
Loading…
Reference in a new issue