From f6d0b09f0d40fdc6fdf1fb0e9997fce5a041a666 Mon Sep 17 00:00:00 2001 From: Svetlozar Kondakov Date: Tue, 1 Oct 2019 07:23:22 +0300 Subject: [PATCH] Fix problem with using audit log under cli --- .gitignore | 1 + src/model/AuditLog.php | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 565dc19..f84fa08 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ docs/build /build /vendor .DS_Store +/.idea diff --git a/src/model/AuditLog.php b/src/model/AuditLog.php index 970ddbc..28be755 100644 --- a/src/model/AuditLog.php +++ b/src/model/AuditLog.php @@ -67,9 +67,7 @@ public function loadLast() */ public function getUserInfo() { - return [ - 'ip' => $_SERVER['REMOTE_ADDR'] - ]; + return isset($_SERVER['REMOTE_ADDR']) ? ['ip' => $_SERVER['REMOTE_ADDR']] : []; } /**