Skip to content

Commit

Permalink
Fix: carriage return in log files
Browse files Browse the repository at this point in the history
  • Loading branch information
Rom1-B committed Nov 27, 2023
1 parent 98a47fc commit dcb6918
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/GLPIMailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public function __construct()
$this->Debugoutput = function ($message, $level) {
Toolbox::logInFile(
'mail-debug',
"$level - $message"
"$level - $message\n"
);
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/MailCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -1082,7 +1082,7 @@ public function buildTicket($uid, \Laminas\Mail\Storage\Message $message, $optio
$tkt['_tag'] = $this->tags;
} else {
//TRANS: %s is a directory
Toolbox::logInFile('mailgate', sprintf(__('%s is not writable'), GLPI_TMP_DIR . "/"));
Toolbox::logInFile('mailgate', sprintf(__('%s is not writable'), GLPI_TMP_DIR . "/") . '\n');
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public function log($message, $warning)
// Do not log if more than 3 log error
if (
$this->log_errors < 3
&& !Toolbox::logInFile($log_file_name, $message . ' @ ', true)
&& !Toolbox::logInFile($log_file_name, $message . ' @\n', true)
) {
$this->log_errors++;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -1620,7 +1620,7 @@ public static function checkCSRF($data)
) {
$requested_url = (isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : 'Unknown');
$user_id = self::getLoginUserID() ?? 'Anonymous';
Toolbox::logInFile('access-errors', "CSRF check failed for User ID: $user_id at $requested_url");
Toolbox::logInFile('access-errors', "CSRF check failed for User ID: $user_id at $requested_url\n");
// Output JSON if requested by client
if (strpos($_SERVER['HTTP_ACCEPT'] ?? '', 'application/json') !== false) {
http_response_code(403);
Expand Down

0 comments on commit dcb6918

Please sign in to comment.