#398 Bug 3542900: URL parsing too restrictive

Don HO


When clicking on a hotspot, the program mistakenly thinks an URL begins or ends too early if it contains a comma.

If you click to the left of the comma in, say, "http://www.test.com/a,b" the program will only try to match "http://www.test.com/a" as a URL. If you click to the right of the comma, it tries to match "b".

Solution: add a comma to the list of allowed characters.

About the parentheses: according to the RFC they are in fact valid URL characters, but they're obviously very uncommon. You are more likely to encounter parentheses enclosing a URL rather than being part of one, like "if you visit the website (http://www.test.com/test.html)...". Personally, if I click on that link I want to go to "test.com/test.html" and not "test.com/test.html)".

Thus, only alphanumerics, the special characters "$-_.+!*'(),", and
reserved characters used for their reserved purposes may be used
unencoded within a URL.



  • Andreas Jonsson

    Andreas Jonsson - 2012-07-12
  • Andreas Jonsson

    Andreas Jonsson - 2012-07-13

    On second thought, url.patch is no good. Instead, how about removing the last character from the URL if it's a comma or parenthesis? See url2.patch. Then N++ would handle all of reasonable cases correctly. Admittedly it would fail on some valid URLs where there's actually supposed to be a comma or parenthesis at the end.

  • Andreas Jonsson

    Andreas Jonsson - 2012-07-13
  • Achin Jain

    Achin Jain - 2012-08-22

    HI, I am currently working on this bug. I have fixed it. Will upload the patch soon. Just want to ask what link should open if the user gives
    1) "http://www.something.com("
    2) "http://www.something.com,,,,"

    In my opinion the links that should open should be
    1) "http://www.something.com("
    2) "http://www.something.com"

  • Don HO

    Don HO - 2012-10-07
    • assigned_to: nobody --> donho
    • priority: 5 --> 8
  • Don HO

    Don HO - 2013-07-31
    • status: open --> closed
    • Group: --> Next_major_release

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks