From c290bb08d60eefe4d8d4ffa9eb57cb70e6c5897b Mon Sep 17 00:00:00 2001 From: freek Date: Thu, 21 May 2015 18:32:25 +0200 Subject: [PATCH] Only use configured default user id if it is numeric --- CHANGELOG.md | 3 +++ src/Spatie/Activitylog/ActivitylogSupervisor.php | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9890a9d..a0d0533 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ All Notable changes to `activitylog` will be documented in this file +### 2.1.1 +- Only use configured default user id if it is numeric + ### 2.1.0 - Added option to specify a default user id diff --git a/src/Spatie/Activitylog/ActivitylogSupervisor.php b/src/Spatie/Activitylog/ActivitylogSupervisor.php index 91a1ed4..2fc3e28 100644 --- a/src/Spatie/Activitylog/ActivitylogSupervisor.php +++ b/src/Spatie/Activitylog/ActivitylogSupervisor.php @@ -96,6 +96,10 @@ public function normalizeUserId($userId) return $this->auth->user()->id; } - return $this->config->get('activitylog.defaultUserId'); + if (is_numeric($this->config->get('activitylog.defaultUserId'))) { + return $this->config->get('activitylog.defaultUserId'); + }; + + return ''; } }