Last modified: 2013-04-15 20:58:16 UTC
Ok, maybe I'm missing some thing really obvious; but: Why are all / in URLs (for example the url given out by image info) escaped with a \ when format=json? / is no special character in JSON, the only one which needs escapement is " Sample Query: http://en.wikipedia.org/w/api.php?action=query&format=json&titles=Image:Test.jpg&prop=imageinfo&iiprop=url Result: [...] "url":"http:\/\/upload.wikimedia.org\/wikipedia\/en\/b\/bd\/Test.jpg" [...]
PHP's json_encode() function does this, no idea why: > echo json_encode(array('foo' => 'http://en.wikipedia.org/w/api.php')); {"foo":"http:\/\/en.wikipedia.org\/w\/api.php"} Marking WONTFIX cause we're using a library implementation that we can reasonably expect not to be stupid (and that at least isn't generating invalid JSON).
Fixed in Gerrit change #50140. Now, on PHP 5.3, str_replace is used to remove the unnecessary backslashes, and on PHP 5.4, the JSON_UNESCAPED_SLASHES flag is used.