Page MenuHomePhabricator

[MEX] Display errors using HTML format
Closed, ResolvedPublic

Description

In Mathematical expression: Simple text input (for T405730), we changed the API errorformat parameter from html to plaintext. However, in the long term we should return to the HTML error format, as it can be more informative (e.g. hyperlinks might have been stripped from the plain text; AbuseFilter errors might have contained an error box).

Acceptance criteria:

  • All wbui2025 API requests use errorformat=html
  • HTML errors are displayed correctly (no double-escaping but also no XSS vulnerability)

Details

Event Timeline

Change #1247982 had a related patch set uploaded (by Sadiya.mohammed13; author: Sadiya.mohammed13):

[mediawiki/extensions/Wikibase@master] Display errors using HTML format

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

I mentioned this on Gerrit but it seems worth pointing out here too: our effort to display useful errors in HTML is somewhat hampered by the weird structure of errors in Wikibase API responses – see T304945. Maybe now is a good time to tackle that task.

Change #1247982 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Display errors using HTML format

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

Not sure if this goes into Tech or Product Verification… let’s try Product.

Is there an example I can check this one on?

@Arian_Bozorg Sure.

  • Open any item page.
  • Create/edit any math expression statement. Type in the value any invalid character like "\".
  • Or, in URL statement type, use a invalid protocol like "hpsfs://".

(before saving open the browser inspector on the network tab and check for the requests "api.php?..." and check the:

  • Save.

Check for:

  • "Payload" tab for "errorformat=html".
  • "Preview/Response" tab and check the "html" node in the response tree.

TV: No issues found and the acceptance criteria are met.
Thank you!