aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2016-10-12 23:31:39 +0200
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2016-10-12 23:31:39 +0200
commit576f9737a8aab276e1571287c1b6ccb23d068b0a (patch)
treedc11bc29a019c31983feb5dabe23add7f50923e2 /lib
parent8ee61c1f788980f8fb862b4cfd75eba5e78a2547 (diff)
Minz::Log bug when currentUser is empty string
`Minz_Session::param('currentUser', '_')` could return an empty string
Diffstat (limited to 'lib')
-rw-r--r--lib/Minz/Log.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Minz/Log.php b/lib/Minz/Log.php
index 2a9e10993..9559a0bd4 100644
--- a/lib/Minz/Log.php
+++ b/lib/Minz/Log.php
@@ -42,7 +42,11 @@ class Minz_Log {
|| ($env === 'production'
&& ($level >= Minz_Log::NOTICE)))) {
if ($file_name === null) {
- $file_name = join_path(USERS_PATH, Minz_Session::param('currentUser', '_'), 'log.txt');
+ $username = Minz_Session::param('currentUser', '');
+ if ($username == '') {
+ $username = '_';
+ }
+ $file_name = join_path(USERS_PATH, $username, 'log.txt');
}
switch ($level) {