Page MenuHomePhabricator

MakeExternalLink returns wgTitle "API" after category edit saving
Closed, InvalidPublic

Description

Reproduce:

  • Edit Linker.php > at the end of MakeExternalLink() set $text = $wgTitle;
  • Edit a category and add an external URL > save it > Link reads "API"

Works as expected when Javascript is disabled.

I checked my scipts, but it's none of mine.

Can anyone reproduce it?

Tested with MW 1.25.2 in latest Chrome.

Event Timeline

Subfader raised the priority of this task from to Medium.
Subfader updated the task description. (Show Details)
Subfader subscribed.
Subfader set Security to None.

If this really is an API bug, please provide the actual API query involved.

Yes, that was me. Can anyone reproduce it?

Anomie: I cannot provide the API query. It happens when you edit category pages. I don't know why the API bumps in, hence this ticket.

Anomie claimed this task.

I don't know why the API bumps in, hence this ticket.

Prior to rMW536f98c, the API would set $wgTitle to "API" because various things would blow up without a title. But 1.25 includes that patch, so it wouldn't be using that title in general anymore. If you're going through action=parse and not specifying a title "API" is still used as the default there and can make its way into $wgTitle, so that could be it.

From the linked discussion, there doesn't seem to be anything to see here. Some script being used there presumably needs to be passing title to action=parse in addition to a text, but without more details we can only guess.

Thanks for the details. Will investigate.