Simple Machines Community Forum

SMF Development => Bug Reports => Fixed or Bogus Bugs => Topic started by: Sir Osis of Liver on August 03, 2017, 05:52:34 PM

Title: Posted url is truncated
Post by: Sir Osis of Liver on August 03, 2017, 05:52:34 PM
Noticed this once before, and it's happened again.  If a url ending with parentheses is added to a post, the last character is not included in the link, and link fails.  Like this -

  https://en.wikipedia.org/wiki/Bayan_(accordion)

Easier to see in this screenshot -


Title: Re: Posted url is truncated
Post by: Arantor on August 03, 2017, 06:27:31 PM
This is actually by design.

The problem is if you put a link in brackets, e.g. I'm talking about a website (http://example.com/)

Now, fixing the bracket breaks *that* link.
Title: Re: Posted url is truncated
Post by: Sir Osis of Liver on August 03, 2017, 06:38:37 PM
That would mean you'd have to look for an open bracket inside the url or before the url, to decide how to handle the closing bracket.  I've only ever seen this at wikipedia, but it's fairly common there.

Title: Re: Posted url is truncated
Post by: efk on August 03, 2017, 07:26:10 PM
I saw it many times on gaming forums, related with stats page, nicks with that kind of symbols at nicks end will be problematic when linking to the forum. Solution is to double place it under bbc url, or the way I like more, to double click on unclickable end of the link and to mark full link and to open in new tab.
Examples:

http://dota.eurobattle.net/la/forum/index.php?action=gameinfo;sa=player;sid=1;nick=^propalica^
http://dota.eurobattle.net/la/forum/index.php?action=gameinfo;sa=player;sid=1;nick=haywire.
http://dota.eurobattle.net/la/forum/index.php?action=gameinfo;sa=player;sid=1;nick=god..of..war
http://dota.eurobattle.net/la/forum/index.php?action=gameinfo;sa=player;sid=1;nick=.t.n.t.
http://dota.eurobattle.net/la/forum/index.php?action=gameinfo;sa=player;sid=1;nick=[bloodthirst]
http://dota.eurobattle.net/la/forum/index.php?action=gameinfo;sa=player;sid=1;nick=[wog]ballack.13
http://dota.eurobattle.net/la/forum/index.php?action=gameinfo;sa=player;sid=1;nick=techni[c4l]
http://dota.eurobattle.net/la/forum/index.php?action=gameinfo;sa=player;sid=1;nick=undead][rox
http://dota.eurobattle.net/la/forum/index.php?action=gameinfo;sa=player;sid=1;nick=^k.
http://dota.eurobattle.net/la/forum/index.php?action=gameinfo;sa=player;sid=1;nick=doiwannaknow..
http://dota.eurobattle.net/la/forum/index.php?action=gameinfo;sa=player;sid=1;nick=wearepathetic-


Same goes for : then , etc

Also we had many times problems when users used symbols like [ ] and something inside, so some weird things were displayed in topics, but that was easily fixed with insert code.

Title: Re: Posted url is truncated
Post by: Arantor on August 04, 2017, 12:50:52 AM
Quote from: Sir Osis of LiverĀ on August 03, 2017, 06:38:37 PM
That would mean you'd have to look for an open bracket inside the url or before the url, to decide how to handle the closing bracket.  I've only ever seen this at wikipedia, but it's fairly common there.

And doing that is insanely difficult with regular expressions. It is possible but it actually requires so much more effort to do at the regex level, we found it could actually bring the site down if enough people made posts with URLs.
Title: Re: Posted url is truncated
Post by: Arantor on August 04, 2017, 12:52:22 AM
Quote from: efk on August 03, 2017, 07:26:10 PM
I saw it many times on gaming forums, related with stats page, nicks with that kind of symbols at nicks end will be problematic when linking to the forum. Solution is to double place it under bbc url, or the way I like more, to double click on unclickable end of the link and to mark full link and to open in new tab.
Examples:

http://dota.eurobattle.net/la/forum/index.php?action=gameinfo;sa=player;sid=1;nick=^propalica^
http://dota.eurobattle.net/la/forum/index.php?action=gameinfo;sa=player;sid=1;nick=haywire.
http://dota.eurobattle.net/la/forum/index.php?action=gameinfo;sa=player;sid=1;nick=god..of..war
http://dota.eurobattle.net/la/forum/index.php?action=gameinfo;sa=player;sid=1;nick=.t.n.t.
http://dota.eurobattle.net/la/forum/index.php?action=gameinfo;sa=player;sid=1;nick=[bloodthirst]
http://dota.eurobattle.net/la/forum/index.php?action=gameinfo;sa=player;sid=1;nick=[wog]ballack.13
http://dota.eurobattle.net/la/forum/index.php?action=gameinfo;sa=player;sid=1;nick=techni[c4l]
http://dota.eurobattle.net/la/forum/index.php?action=gameinfo;sa=player;sid=1;nick=undead][rox
http://dota.eurobattle.net/la/forum/index.php?action=gameinfo;sa=player;sid=1;nick=^k.
http://dota.eurobattle.net/la/forum/index.php?action=gameinfo;sa=player;sid=1;nick=doiwannaknow..
http://dota.eurobattle.net/la/forum/index.php?action=gameinfo;sa=player;sid=1;nick=wearepathetic-


Same goes for : then , etc

Also we had many times problems when users used symbols like [ ] and something inside, so some weird things were displayed in topics, but that was easily fixed with insert code.



[ and ] are problematic on a fundamental level because they're literally parts of bbcode itself as well. As for a lot of the characters there, technically things like ^ shouldn't be parts of URLs anyway...
Title: Re: Posted url is truncated
Post by: Sir Osis of Liver on August 04, 2017, 02:00:01 PM
Eh, no big deal to use [url][/url] tags.
Title: Re: Posted url is truncated
Post by: Arantor on August 04, 2017, 05:04:11 PM
For cases like (), sure, but for the extended case of [] it's a huge deal ;)