From c9bf04a16af1d5fc8faf0b4a1811139dc63584b6 Mon Sep 17 00:00:00 2001 From: SharkyKZ Date: Sun, 13 Oct 2019 18:34:40 +0300 Subject: [PATCH] Fix empty IP case --- libraries/src/Log/Logger/FormattedtextLogger.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libraries/src/Log/Logger/FormattedtextLogger.php b/libraries/src/Log/Logger/FormattedtextLogger.php index 5e5395c98e370..159f8182bbfd7 100644 --- a/libraries/src/Log/Logger/FormattedtextLogger.php +++ b/libraries/src/Log/Logger/FormattedtextLogger.php @@ -192,7 +192,12 @@ protected function formatLine(LogEntry $entry) // Set some default field values if not already set. if (!isset($entry->clientIP)) { - $entry->clientIP = IpHelper::getIp(); + $ip = IpHelper::getIp(); + + if ($ip !== '') + { + $entry->clientIP = $ip; + } } // If the time field is missing or the date field isn't only the date we need to rework it.