Page MenuHomePhabricator

redirecttitle in API:Search returns title object instead of text
Closed, ResolvedPublic

Description

Instead of returning just the redirect page name, like the "title" value does, "redirecttitle" returns the entire Title object. This appears to be the fault of ApiQuerySearch.php rather than any specific search engine.

Example: https://en.wikipedia.org/w/api.php?action=query&list=search&srsearch=Heteroscedasticity&srprop=redirecttitle

Event Timeline

RobinHood70 raised the priority of this task from to Needs Triage.
RobinHood70 updated the task description. (Show Details)
RobinHood70 added a subscriber: RobinHood70.
gerritbot added a subscriber: gerritbot.

Change 188372 had a related patch set uploaded (by Anomie):
API: Don't dump Title object into API result

https://gerrit.wikimedia.org/r/188372

Patch-For-Review

The code was added in ce9bd769 in Nov 1 2010. Certainly it was intended to return only the title instead of the entire object. But for the last 4 years the API delivers the object. Are there any clients that expect the current structure?

FYI: This not effect format=xml because it calls toString for objects (internal reasons).

Change 188372 merged by jenkins-bot:
API: Don't dump Title object into API result

https://gerrit.wikimedia.org/r/188372

Legoktm added a subscriber: Legoktm.

Sounds like a similar thing to T45518 - but with a Title object rather than another User.

Fortunately the Title object output doesn't contain sensitive data.