Skip to content

Commit

Permalink
Fixed undeclared variable
Browse files Browse the repository at this point in the history
  • Loading branch information
eSilverStrike committed Apr 10, 2020
1 parent 4b605d6 commit 21d432a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions system/classes/Log.php
Expand Up @@ -59,7 +59,7 @@ public static function init($pathToLogDir)
*/
public static function __callStatic($name, $arguments)
{
global $_USER;
global $_USER, $LANG01;

$fileName = strtolower(basename($name));
if (substr($fileName, -4) !== '.log') {
Expand Down Expand Up @@ -111,7 +111,12 @@ public static function __callStatic($name, $arguments)
}

if (strpos($flags, 'n') !== false) { // User name
$entry .= 'User: ' . $_USER['username'] . ', ';
if ($_USER['uid'] == 1) {
$username = $LANG01[24]; // Anonymous
} else {
$username = $_USER['username']; // username is not set for anonymous users
}
$entry .= 'User: ' . $username . ', ';
$addedFields = true;
}

Expand Down

0 comments on commit 21d432a

Please sign in to comment.