Kaynağa Gözat

Minz::Log bug when currentUser is empty string

`Minz_Session::param('currentUser', '_')` could return an empty string
Alexandre Alapetite 9 yıl önce
ebeveyn
işleme
576f9737a8
1 değiştirilmiş dosya ile 5 ekleme ve 1 silme
  1. 5 1
      lib/Minz/Log.php

+ 5 - 1
lib/Minz/Log.php

@@ -42,7 +42,11 @@ class Minz_Log {
 		       || ($env === 'production'
 		       || ($env === 'production'
 		       && ($level >= Minz_Log::NOTICE)))) {
 		       && ($level >= Minz_Log::NOTICE)))) {
 			if ($file_name === null) {
 			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) {
 			switch ($level) {