[tbb-commits] [tor-browser/tor-browser-68.1.0esr-9.0-3] fixup! Bug 32111: Fixed issue parsing user-provided brige strings
gk at torproject.org
gk at torproject.org
Thu Oct 17 11:23:22 UTC 2019
commit 83a889d1fcdc8cb01497faaa225987e22d91d94b
Author: Georg Koppen <gk at torproject.org>
Date: Thu Oct 17 11:20:35 2019 +0000
fixup! Bug 32111: Fixed issue parsing user-provided brige strings
---
browser/components/torpreferences/content/parseFunctions.jsm | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/browser/components/torpreferences/content/parseFunctions.jsm b/browser/components/torpreferences/content/parseFunctions.jsm
index 5873c6339983..954759de63a5 100644
--- a/browser/components/torpreferences/content/parseFunctions.jsm
+++ b/browser/components/torpreferences/content/parseFunctions.jsm
@@ -53,7 +53,7 @@ let parseUsernamePassword = function(aUsernameColonPassword) {
return [username, password];
};
-// expect string in the format: ADDRESS:PORT,ADDRESS:PORT,...
+// expects a string in the format: ADDRESS:PORT,ADDRESS:PORT,...
// returns array of ports (as ints)
let parseAddrPortList = function(aAddrPortList) {
let addrPorts = aAddrPortList.split(",");
@@ -62,7 +62,7 @@ let parseAddrPortList = function(aAddrPortList) {
return retval;
};
-// expects a '/n' or '/r/n' delimited string of bridge string, which we split and trim
+// expects a '/n' or '/r/n' delimited bridge string, which we split and trim
// each bridge string can also optionally have 'bridge' at the beginning ie:
// bridge $(type) $(address):$(port) $(certificate)
// we strip out the 'bridge' prefix here
@@ -73,9 +73,9 @@ let parseBridgeStrings = function(aBridgeStrings) {
// then replace contiguous new lines ('\n') with a single one
aBridgeStrings = aBridgeStrings.replace(/[\n]+/g, "\n");
- // split on the newline and foreach bridge string: trim, remove starting 'bridge' string
- // finally discard entries that are empty string; empty string could occur if we receive
- // a new line containing only whitespace
+ // split on the newline and for each bridge string: trim, remove starting 'bridge' string
+ // finally discard entries that are empty strings; empty strings could occur if we receive
+ // a new line containing only whitespace
let splitStrings = aBridgeStrings.split("\n");
return splitStrings.map(val => val.trim().replace(/^bridge\s+/i, ""))
.filter(bridgeString => bridgeString != "");
More information about the tbb-commits
mailing list