Page MenuHomePhabricator

AbuseFilter messages contain local hrefs even for links formed with interwiki prefix
Open, Needs TriagePublic

Description

Main components:

  • MediaWiki abuse filter

Problem:
An error message from Wikidata's abuse filter contains links that point to local pages instead of Wikidata pages when accessed via the Wikibase client.

Steps to reproduce:
Go to pi:Module:Documentation/styles.css > Click on "add links" under the languages section of the left sidebar > Select enwiki and try to add en:Module:Documentation/styles.css > Error notice appears that have links to two locally non-existent pages.

If triggered directly on Wikidata the message points to the right pages.

Example that triggered this task:

Notes:
It’s arguable whether [[Xyz]] should automatically use an absolute href when used in an AbuseFilter or not, but the community should at least be able to solve this issue by explicitly marking the link as an interwiki link with [[d:Xyz]] (where d: is an interwiki prefix for the current wiki).

Screenshots:

image.png (348×497 px, 36 KB)

Acceptance criteria:

  • Links in abuse filter messages point to the right places if triggered locally as well as if triggered via Wikibase client.

Open questions:

Event Timeline

FYI: This dialog is not actually part of the WD Bridge extension but WB client.

Manuel updated the task description. (Show Details)

Thx! Changed it.

Lucas_Werkmeister_WMDE renamed this task from Fix links in abuse filter messages if accessed via the Wikidata bridge to Fix links in abuse filter messages if accessed via Wikibase client sitelink interface.Apr 25 2022, 3:27 PM
Lucas_Werkmeister_WMDE updated the task description. (Show Details)
Manuel renamed this task from Fix links in abuse filter messages if accessed via Wikibase client sitelink interface to AbuseFilter messages contain local hrefs even for links formed with interwiki prefix.Apr 25 2022, 3:42 PM
Manuel updated the task description. (Show Details)
Manuel updated the task description. (Show Details)

This looks like an issue in the AbuseFilter component. Maybe someone from the AbuseFilter team might be able to help?

I'm not familiar with wikidata, so I'm not sure what's really happening here. However, this does not seem to be caused by AbuseFilter itself: IIUC, a wikidata filter is being run on another wiki, but this is NOT happening via the AbuseFilter's own "global filters" feature. In fact, I think AF is being manually triggered by Wikibase (e.g. by running the EditFilterMergedContent hook). AF simply returns a Status object with the error messages, but it's up to the calling code to make sure that those messages are parsed correctly. As an aside, AF does not let you use a customized warning message for global filters, possibly because parsing it in the right context could be difficult.

the AbuseFilter team

No such thing exists, unfortunately.

It looks like we’re making a client-side cross-wiki request from pi.wikipedia.org to www.wikidata.org, and the error in the response contains relative URLs (<a href="/wiki/Special:MyLanguage/Wikidata:Notability"). This isn’t the first time that relative URLs in API responses have caused issues, but I don’t think we have a great solution for it… (the wbformatentities API addresses it using RemexHtml, for example; I don’t remember the other cases I encountered right now). I guess the client-side code should go through the HTML that it receives and turn all relative hrefs into absolute ones by adding the wbRepo.url to them.

Thank you for your thoughts on this @Daimona and @Lucas_Werkmeister_WMDE!