ソースを参照

Merge pull request #1308 from Alkarex/Minz-log-username-bug

Minz::Log bug when currentUser is empty string
Alexandre Alapetite 9 年 前
コミット
f41362a594
1 ファイル変更5 行追加1 行削除
  1. 5 1
      lib/Minz/Log.php

+ 5 - 1
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) {