[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-4' - common/Util.cpp wsd/ClientSession.cpp
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Sun Apr 14 18:53:00 UTC 2019
common/Util.cpp | 8 ++++++--
wsd/ClientSession.cpp | 2 ++
2 files changed, 8 insertions(+), 2 deletions(-)
New commits:
commit 7b5d10a69ad29c771c5dd5e02e4230cc2f2d31af
Author: Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Fri Mar 15 10:51:19 2019 +0100
Commit: Ashod Nakashian <ashnakash at gmail.com>
CommitDate: Sun Apr 14 20:52:40 2019 +0200
Anonymization: don't log when it is disabled.
Also fix unexpected concatenation error in Poco::URI::encode generating
eg. authorid=localhost0 xauthorid=localhost0localhost0 in the output.
Change-Id: I560e47e31884eeb1c662f468436ed7541cfb082d
Reviewed-on: https://gerrit.libreoffice.org/69299
Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
diff --git a/common/Util.cpp b/common/Util.cpp
index a27ed5a22..caea764a4 100644
--- a/common/Util.cpp
+++ b/common/Util.cpp
@@ -659,7 +659,9 @@ namespace Util
if (plain.empty() || anonymized.empty())
return;
- LOG_TRC("Anonymizing [" << plain << "] -> [" << anonymized << "].");
+ auto &log = Log::logger();
+ if (log.trace() && plain != anonymized)
+ LOG_TRC("Anonymizing [" << plain << "] -> [" << anonymized << "].");
std::unique_lock<std::mutex> lock(AnonymizedMutex);
@@ -674,7 +676,9 @@ namespace Util
const auto it = AnonymizedStrings.find(text);
if (it != AnonymizedStrings.end())
{
- LOG_TRC("Found anonymized [" << text << "] -> [" << it->second << "].");
+ auto &log = Log::logger();
+ if (log.trace() && text != it->second)
+ LOG_TRC("Found anonymized [" << text << "] -> [" << it->second << "].");
return it->second;
}
}
diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
index 7cd98ae69..efbac7dab 100644
--- a/wsd/ClientSession.cpp
+++ b/wsd/ClientSession.cpp
@@ -420,12 +420,14 @@ bool ClientSession::loadDocument(const char* /*buffer*/, int /*length*/,
std::string encodedUserId;
Poco::URI::encode(getUserId(), "", encodedUserId);
oss << " authorid=" << encodedUserId;
+ encodedUserId = "";
Poco::URI::encode(LOOLWSD::anonymizeUsername(getUserId()), "", encodedUserId);
oss << " xauthorid=" << encodedUserId;
std::string encodedUserName;
Poco::URI::encode(getUserName(), "", encodedUserName);
oss << " author=" << encodedUserName;
+ encodedUserName = "";
Poco::URI::encode(LOOLWSD::anonymizeUsername(getUserName()), "", encodedUserName);
oss << " xauthor=" << encodedUserName;
}
More information about the Libreoffice-commits
mailing list