Skip to content
This repository has been archived by the owner on Jun 1, 2019. It is now read-only.

Commit

Permalink
Only use configured default user id if it is numeric
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed May 21, 2015
1 parent 1b024e1 commit c290bb0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 5 additions & 1 deletion src/Spatie/Activitylog/ActivitylogSupervisor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 '';
}
}

0 comments on commit c290bb0

Please sign in to comment.