From 576f9737a8aab276e1571287c1b6ccb23d068b0a Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Wed, 12 Oct 2016 23:31:39 +0200 Subject: Minz::Log bug when currentUser is empty string `Minz_Session::param('currentUser', '_')` could return an empty string --- lib/Minz/Log.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/Minz/Log.php') 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) { -- cgit v1.2.3