Slight bug in URL parsing
#1
Original Poster
A FlyerTalk Posting Legend




Join Date: Apr 2004
Location: GVA (Greater Vancouver Area)
Programs: D.R.E.A.D. Gold card holder
Posts: 53,184
Slight bug in URL parsing
The URL auto parser (the one that takes URLs and automatically puts them inside a [.url][/.url] pair) does not behave correctly with parenthesis.
Example: enter the following in a post:
and you will see the generated [.url][/.url] pair will have the right parenthesis inside the tag, i.e. See this link ([.url]http://www.united.com/page/article/0,6722,51366,00.html)[/.url]
(Note: I use .url in this post to prevent the parser from actually interpreting the url tags).
Example: enter the following in a post:
Code:
See this link (http://www.united.com/page/article/0,6722,51366,00.html)
(Note: I use .url in this post to prevent the parser from actually interpreting the url tags).
#2
Guest
Posts: n/a
I believe that the ')' character is a valid character that can be part of a url string and that this is not quite a bug as there are cases were a valid url could contain/end with a ')' in it, it would break those urls with auto-parse if it didn't include it. I think the best solution now is to have white space (spaces or returns) before and after urls that are left to auto parse or manually entering/using the link tool for applications of a url like this.
#3
Original Poster
A FlyerTalk Posting Legend




Join Date: Apr 2004
Location: GVA (Greater Vancouver Area)
Programs: D.R.E.A.D. Gold card holder
Posts: 53,184
I believe that the ')' character is a valid character that can be part of a url string and that this is not quite a bug as there are cases were a valid url could contain/end with a ')' in it, it would break those urls with auto-parse if it didn't include it. I think the best solution now is to have white space (spaces or returns) before and after urls that are left to auto parse or manually entering/using the link tool for applications of a url like this.
#4
Guest
Posts: n/a
Any non-whitespace character is valid in a URL, so that argument doesn't hold water. The auto-parser works with URLs followed by most other punctuation (periods, commas, exclamation points), which are all not only definitely valid, but very common in URLs. Since the 99.9999% use case for a right parenthesis is to set off a URL, the 0.0001% case of actually wanting to include one in a URL should be the one that people have to handle specially.
edit, testing:
(http://www.united.com/page/article/0,6722,51366,00.html)
Last edited by Tim at WebFlyer; Jan 4, 2007 at 11:14 am Reason: testing
#6
Original Poster
A FlyerTalk Posting Legend




Join Date: Apr 2004
Location: GVA (Greater Vancouver Area)
Programs: D.R.E.A.D. Gold card holder
Posts: 53,184
#7
Guest
Posts: n/a
Well, I've manually corrected the posts where I had it, but it happens every time I try (such as this one: http://www.united.com/page/article/0...51366,00.html).
(http://www.united.com/page/article/0,6722,51366,00.html)
That worked let me try another:
(http://www.united.com/page/article/0,6722,51366,00.html).
That worked, another try:
(such as this one: http://www.united.com/page/article/0...51366,00.html).
Ok, I think I see what the condition is that causes this. Thanks,

