remove passwords from logfile

This commit is contained in:
Bjoern Schiessle 2013-11-26 12:26:32 +01:00
parent dc67c7efa9
commit 62afe7fe7a
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');