Bug 1274242 - Linkify should not stop at |. r=valentin a=rkent CLOSED TREE THUNDERBIRD470b1_2016053115_RELBRANCH
authorJorg K
Mon, 23 May 2016 05:45:00 +0200
branchTHUNDERBIRD470b1_2016053115_RELBRANCH
changeset 324511 79c3a44444119080cec1c59e2d9ed65dc92262ee
parent 324510 86dfca096aceb2ce4cde1f64ceb945d81f2b6d3d
child 324512 e83a40f3367a162501ecc2c0988df038156d45c3
push id6043
push userkent@caspia.com
push dateWed, 01 Jun 2016 22:07:57 +0000
treeherdermozilla-beta@e83a40f3367a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvalentin, rkent
bugs1274242
milestone47.0
Bug 1274242 - Linkify should not stop at |. r=valentin a=rkent CLOSED TREE
netwerk/streamconv/converters/mozTXTToHTMLConv.cpp
netwerk/test/unit/test_mozTXTToHTMLConv.js
--- a/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp
+++ b/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp
@@ -303,17 +303,16 @@ mozTXTToHTMLConv::FindURLEnd(const char1
     bool seenOpeningParenthesis = false; // there is a '(' earlier in the URL
     bool seenOpeningSquareBracket = false; // there is a '[' earlier in the URL
     for (; int32_t(i) < aInStringLength; i++)
     {
       // These chars mark the end of the URL
       if (aInString[i] == '>' || aInString[i] == '<' ||
           aInString[i] == '"' || aInString[i] == '`' ||
           aInString[i] == '}' || aInString[i] == '{' ||
-          aInString[i] == '|' ||
           (aInString[i] == ')' && !seenOpeningParenthesis) ||
           (aInString[i] == ']' && !seenOpeningSquareBracket) ||
           // Allow IPv6 adresses like http://[1080::8:800:200C:417A]/foo.
           (aInString[i] == '[' && i > 2 &&
            (aInString[i - 1] != '/' || aInString[i - 2] != '/')) ||
           IsSpace(aInString[i]))
           break;
       // Disallow non-ascii-characters for email.
--- a/netwerk/test/unit/test_mozTXTToHTMLConv.js
+++ b/netwerk/test/unit/test_mozTXTToHTMLConv.js
@@ -105,16 +105,20 @@ function run_test() {
     },
     {
       input: "ipv6 2: http://[::ffff:127.0.0.1]/#yay test",
       url: "http://[::ffff:127.0.0.1]/#yay"
     },
     {
       input: "ipv6 parenthesis port: (http://[2001:db8::1]:80/) test",
       url: "http://[2001:db8::1]:80/"
+    },
+    {
+      input: "test http://www.map.com/map.php?t=Nova_Scotia&markers=//Not_a_survey||description=plm2 test",
+      url: "http://www.map.com/map.php?t=Nova_Scotia&amp;markers=//Not_a_survey||description=plm2"
     }
   ];
 
   const scanHTMLtests = [
     {
       input: "http://foo.example.com",
       shouldChange: true
     },