broken links when a url have the [] signs

Started by fapencio, July 31, 2014, 12:35:51 PM

Previous topic - Next topic

fapencio

Hi, my problem is this: when a user post a link with have this signs: []  the url of link broken it, example:

http://www.sld.cu/galerias/pdf/sitios/tuberculosis/tb-labs-cultivo[2].pdf

in the above url, the link is broken in "cultivo" and when I clik in them, the web browser sends me to the wrong link that is broken

please help
My smf forum is 2.0.10 version
my theme is default
language spanish es utf8

Arantor

There's no way to fix that, seeing how [ and ] are using in bbcode themselves.

Steve

About the only option I see is to put the url in code or nobbc tags and have whoever needs the url copy and paste it into their browser's address bar.
DO NOT pm me for support!

Kindred

http://stackoverflow.com/questions/1547899/which-characters-make-a-url-invalid

answer 59...
Quote
The '[' and ']' characters are <reserved> characters and should be percent escaped if not used as delimiters in the scheme-specific syntax. The spec says:

    "URI producing applications should percent-encode data octets that correspond to characters in the reserved set unless these characters are specifically allowed by the URI scheme to represent data in that component."

(Note - the operative work here is "should", and not "shall" or "must". This is advisory, not prescriptive.)

The next sentence of the spec says this:

    "If a reserved character is found in a URI component and no delimiting role is known for that character, then it must be interpreted as representing the data octet corresponding to that character's encoding in US-ASCII."

(Note that the operative word is "must". This is saying what a URI means if someone ignores the advice of the previous sentence.)


so, it would seem that using unescaped  [ or ] in a URL is improper...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

fapencio

thanks for your answers, you are very kind, and their arguments are correct and entirely valid, but I am looking for a solution to my problem, please if anyone knows what code needs to be altered hope it helps me
My smf forum is 2.0.10 version
my theme is default
language spanish es utf8

Arantor

It's not doable without rewriting the guts of SMF. I know, I've tried.

margarett

Some time ago I remember seeing something about a php BBC parser
Maybe something like this can handle it?
http://jbbcode.com/

Of course, to use it in SMF means... To rewrite its guts :P
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Arantor

It's more than that, you'd have to rewrite part of that parser too.

JBlaze

The easiest way to get around it is to use %5B and %5D respectively for [ and ].

Of course, this requires your members to know how to do this, and takes some time. But it's a workaround for now.

Example: http://www.sld.cu/galerias/pdf/sitios/tuberculosis/tb-labs-cultivo%5B2%5D.pdf

Edit: Phrasing
Jason Clemons
Former Team Member 2009 - 2012

Arantor


JBlaze

Jason Clemons
Former Team Member 2009 - 2012

Advertisement: