Merge pull request #6053 from owncloud/remove_passwords_from_log
remove passwords from logfile
This commit is contained in:
commit
eca9f69282
|
@ -68,6 +68,8 @@ class OC_Log_Owncloud {
|
||||||
$timezone = new DateTimeZone('UTC');
|
$timezone = new DateTimeZone('UTC');
|
||||||
}
|
}
|
||||||
$time = new DateTime(null, $timezone);
|
$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=array('app'=>$app, 'message'=>$message, 'level'=>$level, 'time'=> $time->format($format));
|
||||||
$entry = json_encode($entry);
|
$entry = json_encode($entry);
|
||||||
$handle = @fopen(self::$logFile, 'a');
|
$handle = @fopen(self::$logFile, 'a');
|
||||||
|
|
Loading…
Reference in New Issue