Selaa lähdekoodia

Minz::Log bug when currentUser is empty string

`Minz_Session::param('currentUser', '_')` could return an empty string
Alexandre Alapetite 9 vuotta sitten
vanhempi
commit
576f9737a8
1 muutettua tiedostoa jossa 5 lisäystä ja 1 poistoa
  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) {