News:

Join the Facebook Fan Page.

Main Menu

URL Problem

Started by Danielㅤ, May 23, 2023, 06:12:40 PM

Previous topic - Next topic

Danielㅤ

Hello, the other day giving support to a user I noticed a bug in this new version 2.1 of SMF, the bug occurs when another URL is inserted as a parameter in a URL/link, a clear example is when using web archive, here you can see the error:

https://web.archive.org/web/20190118235245/https://www.simplemachines.org/community/index.php?board=16.0

as you can notice the URL is cut off after the https://.


Greetings

Kindred

Meh...  a second https is not actually valid in the url under normal circumstances
Сл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."

Sesquipedalian

Hm. Yes, technically that is a bug.

However, if you look carefully, you'll notice that the detected URL actually ends after the second "https:/", rather than after "https://".

In general, the only place in a URL where two slashes are supposed to occur in a row is right after the scheme declaration. Therefore, SMF's autolinker assumes that if it encounters two slashes anywhere later in the string, it must have already reached the end of the current URL, and so it cuts off at that point.

Unfortunately, fixing this bug might be a bit tricky. Tweaking the relevant code so that it detected this URL correctly would be easy. Tweaking the relevant code in a way that didn't also cause it to do the wrong thing in a whole bunch of other cases will be difficult.

All of which is to say that I will almost certainly try to fix this bug, but that you shouldn't hold your breath waiting for the fix.

In the meantime, you can work around this bug by wrapping such URLs in [url][/url] tags.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

Danielㅤ

Thanks for the answers.

Kindred
Yes, it is true, it is not common for one url to be inside another, however web archive is a website that is often used, in SMF 2.0 there is no such problem with the url.


Sesquipedalian
Thanks for the explanation.
If I figured it was a bug, you're right, the url is cut off after the https:/ in the first forward slash, I hadn't noticed.
I'm glad to know that you're going to fix it at some point  ;D

If I did a test using the url tag and I have noticed that the problem is solved, this way can be used with the web archive urls so that they do not cause the conflict of being cut off.

Thanks again mates!

Advertisement: