www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit db8bb3484d68f4f0d6482581f24741b402a889cd
parent b171b15d87fb41d62d60aa58acc33c04e3fbe8b4
Author: Dan Stillman <dstillman@zotero.org>
Date:   Wed, 16 Aug 2017 00:38:15 +0200

Update password-hiding logic for malformed-XML XHR errors in reports

Diffstat:
Mchrome/content/zotero/xpcom/zotero.js | 10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js @@ -41,7 +41,6 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js"); this.debug = debug; this.log = log; this.logError = logError; - this.getErrors = getErrors; this.localeJoin = localeJoin; this.setFontSize = setFontSize; this.flattenArguments = flattenArguments; @@ -1297,21 +1296,22 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js"); } - function getErrors(asStrings) { + this.getErrors = function (asStrings) { var errors = []; for (let msg of _startupErrors.concat(_recentErrors)) { - // Remove password in malformed XML messages + let altMessage; + // Remove password in malformed XML errors if (msg.category == 'malformed-xml') { try { // msg.message is read-only, so store separately - var altMessage = msg.message.replace(/(file: "https?:\/\/[^:]+:)([^@]+)(@[^"]+")/, "$1********$3"); + altMessage = msg.message.replace(/(https?:\/\/[^:]+:)([^@]+)(@[^"]+)/, "$1****$3"); } catch (e) {} } if (asStrings) { - errors.push(altMessage ? altMessage : msg.message) + errors.push(altMessage || msg.message) } else { errors.push(msg);