Merge pull request #6053 from owncloud/remove_passwords_from_log

remove passwords from logfile
This commit is contained in:
Morris Jobke 2013-11-26 04:53:02 -08:00
commit eca9f69282
1 changed files with 2 additions and 0 deletions

View File

@ -68,6 +68,8 @@ class OC_Log_Owncloud {
$timezone = new DateTimeZone('UTC');
}
$time = new DateTime(null, $timezone);
// remove username/passswords from URLs before writing the to the log file
$message = preg_replace('/\/\/(.*):(.*)@/', '//xxx:xxx@', $message);
$entry=array('app'=>$app, 'message'=>$message, 'level'=>$level, 'time'=> $time->format($format));
$entry = json_encode($entry);
$handle = @fopen(self::$logFile, 'a');