It's not a WTF, it's just a bug. You have to encode the values properly, or they won't handle some characters correctly.
Encoding values is a tricky business that has to be done in several steps in this case, as you have an URL inside and URL inside a Javascript string inside HTML code.
First the URL has to be URL encoded to be a part of the query string of another URL, which obviously hasn't been done, as it still contains slashes instead of %2f.
Then the string containing the URL has to be encoded into a proper Javascript string, which obviously hasn't been done, as it still contains a single apostrophe instead of the backslash-apostrophe sequence that is used to put an apostrophe in an apostrophe delimited string.
Then the entire Javascript code string has to be HTML encoded to be put inside the value of a property in an HTML tag. There is no character that needs HTML encoding in this case, so I can't tell if this has been done or not. Judging from how much encoding that has been done so far, it's not very likely that this has been done either.