'Internet Explorer: HTML entities in URL

I have got the following PHP code:

echo "<input type='image' src='myImage.png' onClick='javascript:location.href = \"index.php?p=1&copy=true\"' />";

If I click on the image, Chrome redirects to index.php?p=1&copy=true. But if I click on the image in Internet Explorer 11, it redirects to index.php?p=1©=true.

Internet Explorer seems to replace HTML entities in URLs.

I tried using &amp; instead of &, but I got the same problem: IE replaces it into the copyright symbol.

How can I use &copy in my URL? I know that one possible solution would be to replace &copy with &whatever, but than I must change my hole system.

There are also other people with the same problem:

https://gist.github.com/pguillory/5136408



Solution 1:[1]

Why not just swap the variables?

Instead of index.php?p=1&copy=true it should still work with index.php?copy=true&amp;p=1.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 unor