Page MenuHomePhabricator

api.php produces invalid json when 'callback' argument is supplied
Closed, InvalidPublic

Description

REQUEST:
  http://en.wikipedia.org/w/api.php?action=opensearch&search=JFK&format=json&callback=zzz

RESPONSE:
/**/zzz(
[
  "JFK",
  [
    "JFK",
    "JFK (film)",
    "JFK Olimps",
    "JFK Express",
    "JFK: Reloaded",
    "JFK in Ireland",
    "JFK Expressway",
    "Jfk",
    "JFK (disambiguation)",
    "JFK/UMass (MBTA station)"
  ]
]
)

Invalid part: /**/zzz(

Please note that replacing 'callback' with other invalid argument changes response to contain a warning inside of the valid json.
So the side issue is: Why undocumented 'callback' argument is treated differently compared to other invalid arguments?

Event Timeline

Yuri271 raised the priority of this task from to Needs Triage.
Yuri271 updated the task description. (Show Details)
Yuri271 changed Security from none to None.
Yuri271 subscribed.