ID:2625379
 
Resolved
Another aspect of the link() fix was apparently incompatible with multiple websites.
BYOND Version:513
Operating System:Windows 8
Web Browser:Firefox 78.0
Applies to:Dream Seeker
Status: Resolved (513.1536)

This issue has been resolved.
Descriptive Problem Summary:
If you attempt to send a link() to a client which contains the "&" character, the "&"s in the URL are replaced with ";".

Numbered Steps to Reproduce Problem:
1) Run the code snippet below.
2) Observe it opens the wrong URL.

Code Snippet (if applicable) to Reproduce Problem:
CLIENT << link("https://www.example.org/forum/index.php?a=1&b=2")


Expected Results:
Opens https://www.example.org/forum/index.php?a=1&b=2 in your browser.

Actual Results:
Opens https://www.example.org/forum/index.php?a=1;b=2 in your browser.
The & is replaced with ;

Does the problem occur:
It seems to happen every time.

When does the problem NOT occur?
On older versions of byond, such as 1528.

Did the problem NOT occur in any earlier versions?
No, it only started happening once I updated to 513.1534.

Workarounds:
Re-do all the URLs on your website to avoid using the & character.
Good luck.
This is not a bug. This is intended behavior due to the way & may be handled on the command line.

I'm willing to change this if there's evidence it won't impact command line behavior in certain situations.
I can't speak to the command line behavior part.

All I can say is: I really hope this is changed. We use third-party software (like MediaWiki, for our game manual/guides) which relies on the ability to have & in URLs.
Most web server software should be handling ; the same way as & in that case, or there's an option to do so. Semicolon is actually perfectly valid in URLs for this purpose.
To the best of my knowledge, I have never seen a single website, ever, that uses ";" instead of "&" as its default parameter separator in URLs. I asked a German friend who works in a software development house, and he's never heard any website doing this either.

When I tested some of the big US-oriented sites from https://en.wikipedia.org/wiki/List_of_most_popular_websites I found that most of them don't support the use of ";".
Examples:
- Google (uses & by default, rejects ;)
-- works: https://www.google.com/ search?source=hp&q=test+search&oq=test+search
-- rejected: https://www.google.com/ search?source=hp;q=test+search;oq=test+search
- Wikipedia (uses & by default, rejects ;)
-- works: https://en.wikipedia.org/w/ index.php?search=Test+Search&title=Special%3ASearch&go=Go&ns 0=1
-- rejected: https://en.wikipedia.org/w/ index.php?search=Test+Search;title=Special%3ASearch;go=Go;ns 0=1
- Amazon (uses & by default, if you try to change it to ;, it forcibly changes it back to & as a hint you should not be even trying to use ;)
- Reddit.com (uses & by default, if you try to change it to ;, you get a different, incorrect page)

Even if you think that ";" is a standard, it is obviously not widely supported, and thus eliminating support for "&" and forcing people to use ";" will break things.

Yes, in theory I could try to reconfigure our website/software to treat ";" like "&", but:
1) I shouldn't have to be trying to change our website to make it more compatible with the way Byond handles links. Determining whether a link is valid is the job of the webserver, not Byond. Byond shouldn't be altering the links it is given in any way. Especially not in a way which is not mentioned in the documentation: http://www.byond.com/docs/ref/#/proc/link
2) Even if I can change our website, I can't change other peoples' websites, and that creates a problem for any Byond game author whose game needs to open any other website that uses query params.
Kyet is right.

"The W3C Recommendation from 1999 is obsolete. The current status, according to the 2014 W3C Recommendation, is that semicolon is now illegal as a parameter separator"

https://stackoverflow.com/questions/3481664/ semicolon-as-url-query-separator

The ampersand is necessary to use URLs properly with other services over HTTP.

I don't think there's a way to justify disabling such a widely relied upon feature.

Lummox JR resolved issue with message:
Another aspect of the link() fix was apparently incompatible with multiple websites.
In response to FlattestGuitar9
FlattestGuitar9 wrote:
Kyet is right.

"The W3C Recommendation from 1999 is obsolete. The current status, according to the 2014 W3C Recommendation, is that semicolon is now illegal as a parameter separator"

https://stackoverflow.com/questions/3481664/ semicolon-as-url-query-separator

The ampersand is necessary to use URLs properly with other services over HTTP.

I don't think there's a way to justify disabling such a widely relied upon feature.


Nice catch, now I can stop making sure it works on my stuff too.

Just everyone remember this is all Nadrew's fault.
Just everyone remember, this is all Microsoft's fault.

(My scapegoat job has a scapegoat someone else clause in the contract.)