Fixing an Apostrophe URL Bug

  • Thread starter Thread starter A.T.
  • Start date Start date
AI Thread Summary
A URL containing an apostrophe, such as Euler's identity, generates a broken link due to improper escaping in the internally generated URL. This issue is particularly problematic in Chrome, where users may encounter a "406 Not Acceptable" error when clicking on certain links. Workarounds include opening links in a new tab and modifying the URL to remove problematic characters. The discussion also highlights that the Viglink tracking system may contribute to these issues, with some users questioning its necessity and functionality across different browsers. Overall, the conversation emphasizes the need for better handling of special characters in URLs to improve user experience.
A.T.
Science Advisor
Messages
12,919
Reaction score
3,964
Posting an URL with an apostrophe, like:

http://en.wikipedia.org/wiki/Euler's_identity

creates a broken link, because the apostrophe is not properly escaped in the internally generated URL:

http://api.viglink.com/api/click?format=go&key=6afc78eea2339e9c047ab6748b0d37e7&loc=http%3A%2F%2Fwww.physicsforums.com%2Fshowthread.php%3Ft%3D690460&v=1&libId=812d4dfe-4823-41b6-96f6-4bf0b020e903&out=http%3A%2F%2Fen.wikipedia.org%2Fwiki%2FEuler[B]'[/B]s_identity&ref=http%3A%2F%2Fwww.physicsforums.com%2Fforumdisplay.php%3Ff%3D111&title=Beautiful%20Equations&txt=http%3A%2F%2Fen.wikipedia.org%2Fwiki%2FEuler's_identity&jsonp=vglnk_jsonp_13680463957848[/QUOTE]

Correct URL should be:

http://api.viglink.com/api/click?format=go&key=6afc78eea2339e9c047ab6748b0d37e7&loc=http%3A%2F%2Fwww.physicsforums.com%2Fshowthread.php%3Ft%3D690460&v=1&libId=812d4dfe-4823-41b6-96f6-4bf0b020e903&out=http%3A%2F%2Fen.wikipedia.org%2Fwiki%2FEuler[B]%27[/B]s_identity&ref=http%3A%2F%2Fwww.physicsforums.com%2Fforumdisplay.php%3Ff%3D111&title=Beautiful%20Equations&txt=http%3A%2F%2Fen.wikipedia.org%2Fwiki%2FEuler's_identity&jsonp=vglnk_jsonp_13680461919027[/QUOTE]
 
Last edited by a moderator:
Physics news on Phys.org
But the link works. :confused:

Edit: By the way, a similar thing happens when you search the forum for "Poincaré" for example. The search results will be links like this: https://www.physicsforums.com/showthread.php?t=689398&highlight=poincar%E9
Code:
https://www.physicsforums.com/showthread.php?t=689398&highlight=poincar%E9
If you click it, you will get a 406 Not Acceptable. So what I always do is to right-click, open link in new tab, and then delete the & and everything to the right of it from the URL.

Edit 2: I'm using Firefox.
 
Last edited:
Fredrik said:
But the link works. :confused:

hmmm it's just a white page for me
 
Works on Firefox
Bugs on Chorme

Other special characters might be affected too.
 
Viglink support says

The character encoding is handled by your browser's URL bar, it is not unique to the VigLink API. Some browsers will automatically escape/encode all characters in URLs, others will only do some and not others.
 
It looks like a Chrome bug:

1) Click the link -> white page
2) Open in new tab -> page displays OK
 
I am wondering why that detour via viglink.com is used at all. And why it appears to be present for Chrome only.Edit: Why does Chrome need an additional website to track clicks? I think the browser does that anyway? :D
 
Last edited:
mfb said:
I am wondering why that detour via viglink.com is used at all. And why it appears to be present for Chrome only.

Click tracking
 
  • #10
mfb said:
I am wondering why that detour via viglink.com is used at all.
Big Brother

mfb said:
And why it appears to be present for Chrome only.
Because Google product users don't mind being spied on. But it's still annoying if those detours break something. Now at least I know a workaround.
 
  • #11
mfb said:
I am wondering why that detour via viglink.com is used at all. And why it appears to be present for Chrome only.Edit: Why does Chrome need an additional website to track clicks? I think the browser does that anyway? :D

Why do you think vigilink usage only occurs for chrome? I see it referenced when PF is used by firefox (and I use software that shows what url's are accessed during navigation).
 
Last edited:
  • #12
PAllen said:
I see it referenced when PF is used by firefox (and I use software that shows what url's are accessed during navigation).
Same here and I have no problem with it as I want PF to grow and prosper.
 
  • #13
PAllen said:
Why do you think vigilink usage only occurs for chrome? I see it referenced when PF is used by firefox (and I use software that shows what url's are accessed during navigation).
This is what the forum sends to my firefox:

Code:
<div id="post_message_4376188">

Posting an URL with an apostrophe, like:<br />
<br />
<a href="[PLAIN]http://en.wikipedia.org/wiki/Euler&#[b][/b]39;s_identity"[/PLAIN]  target="_blank">[PLAIN]http://en.wikipedia.org/wiki/Euler's_identity</a><br[/PLAIN]  />
<br />
[...]
It is the converted BB-Code, and nothing else. It is up to the browser to interpret &#39;, and firefox can do that.
 
Last edited by a moderator:
  • #14
mfb said:
This is what the forum sends to my firefox:

Code:
<div id="post_message_4376188">

Posting an URL with an apostrophe, like:<br />
<br />
<a href="[PLAIN]http://en.wikipedia.org/wiki/Euler&#[b][/b]39;s_identity"[/PLAIN]  target="_blank">[PLAIN]http://en.wikipedia.org/wiki/Euler's_identity</a><br[/PLAIN]  />
<br />
[...]
It is the converted BB-Code, and nothing else. It is up to the browser to interpret &#39;, and firefox can do that.

I wasn't talking about what happens with this url, but the general use of viglink by PF, which I assume is benign (and good for PF). Code like the following gets executed during navigation around PF:

var vglnk = { api_url: '//api.viglink.com/api',
key: '6afc78eea2339e9c047ab6748b0d37e7' };

(function(d, t) {
var s = d.createElement(t); s.type = 'text/javascript'; s.async = true;
s.src = ('https:' == document.location.protocol ? vglnk.api_url :
'//cdn.viglink.com/api') + '/vglnk.js';
var r = d.getElementsByTagName(t)[0]; r.parentNode.insertBefore(s, r);
}(document, 'script'));
 
Last edited by a moderator:
Back
Top