From 3dda70baf138fc4699f3cdeb8ee625c721091c09 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 3 Feb 2018 21:46:28 -0500 Subject: [PATCH 1/3] Add system.dlogip setting usage in dlogger() --- include/text.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/text.php b/include/text.php index dc604124fd..285ab751e3 100644 --- a/include/text.php +++ b/include/text.php @@ -737,12 +737,16 @@ function dlogger($msg, $level = 0) { return; } - $logfile = Config::get('system','dlogfile'); - + $logfile = Config::get('system', 'dlogfile'); if (! $logfile) { return; } + $dlogip = Config::get('system', 'dlogip'); + if ($dlogip && $_SERVER['REMOTE_ADDR'] != $dlogip) { + return; + } + if (count($LOGGER_LEVELS) == 0) { foreach (get_defined_constants() as $k => $v) { if (substr($k, 0, 7) == "LOGGER_") { From 16c6806c5b32d8fb9ae80c3ca6c12601c35256ca Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 3 Feb 2018 21:46:42 -0500 Subject: [PATCH 2/3] Add documentation for system.dlogip setting --- doc/htconfig.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/htconfig.md b/doc/htconfig.md index 8a98dc1039..e09c37b74d 100644 --- a/doc/htconfig.md +++ b/doc/htconfig.md @@ -41,6 +41,7 @@ Example: To set the automatic database cleanup process add this line to your .ht * **disable_email_validation** (Boolean) - Disables the check if a mail address is in a valid format and can be resolved via DNS. * **disable_url_validation** (Boolean) - Disables the DNS lookup of an URL. * **dlogfile - location of the developer log file +* **dlogip - restricts develop log writes to requests originating from this IP address * **frontend_worker_timeout** - Value in minutes after we think that a frontend task was killed by the webserver. Default value is 10. * **hsts** (Boolean) - Enables the sending of HTTP Strict Transport Security headers * **ignore_cache** (Boolean) - For development only. Disables the item cache. From fd76b15638feae5857ab3157cb8784b60a9e4448 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 4 Feb 2018 08:58:29 -0500 Subject: [PATCH 3/3] Add is_null check --- include/text.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/text.php b/include/text.php index 285ab751e3..26b153549f 100644 --- a/include/text.php +++ b/include/text.php @@ -743,7 +743,7 @@ function dlogger($msg, $level = 0) { } $dlogip = Config::get('system', 'dlogip'); - if ($dlogip && $_SERVER['REMOTE_ADDR'] != $dlogip) { + if (!is_null($dlogip) && $_SERVER['REMOTE_ADDR'] != $dlogip) { return; }