summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <morris.jobke@gmail.com>2013-11-26 04:53:02 -0800
committerMorris Jobke <morris.jobke@gmail.com>2013-11-26 04:53:02 -0800
commiteca9f69282a936200bd70b872ae48a4c2ddf0bc5 (patch)
tree97077b2cb80332838f848c76adf4d91703924a49
parent16ce56553cdcc7396916a1fa57e5f68818e33692 (diff)
parent62afe7fe7af6fae6f5b23172b819fb8298ef291e (diff)
downloadnextcloud-server-eca9f69282a936200bd70b872ae48a4c2ddf0bc5.tar.gz
nextcloud-server-eca9f69282a936200bd70b872ae48a4c2ddf0bc5.zip
Merge pull request #6053 from owncloud/remove_passwords_from_log
remove passwords from logfile
-rw-r--r--lib/private/log/owncloud.php2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/private/log/owncloud.php b/lib/private/log/owncloud.php
index 15cace88f41..4c86d0e45e0 100644
--- a/lib/private/log/owncloud.php
+++ b/lib/private/log/owncloud.php
@@ -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');