Page MenuHomePhabricator

Electron not rendering titles with questions marks on Italian wikipedia
Closed, ResolvedPublic

Description

It seems titles with question marks (maybe other characters) are not being rendered correctly

Steps to reproduce:

  1. Go to https://it.wikipedia.org/wiki/Aha_oe_feii%3F
  2. Select "Scarica come PDF" and colona singola

Expected: PDF for "Aha oe feii?" should be rendered
Observed: PDF for "Aha oe feii" is rendered, which is a page that doesn't exist

Notes:

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 29 2017, 2:14 PM
GWicke triaged this task as High priority.Jun 29 2017, 5:16 PM
GWicke edited projects, added Services (next); removed Services.

I looked into this a little bit. I verified that making the request directly to the REST API does not change the outcome. The response contains the title including the trailing question mark as the file name.

This establishes that

  • RESTBase receives the correct title, including the trailing question mark, and
  • the issue is either in how RESTBase makes the request to electron, or in how electron processes the request.

Looking at the RESTBase PDF render module, it seems the requested title is percent-encoded only once in a query string context. The decoded URL would then contain two raw question marks, one from the title, and the other from ?printable=yes.

The reason why the example on enwiki works, is that https://en.wikipedia.org/wiki/Do_Androids_Dream_of_Electric_Sheep is a redirect page pointing to https://en.wikipedia.org/wiki/Do_Androids_Dream_of_Electric_Sheep%3F. As a result, electron still manages to retrieve the content page, despite addressing it without the trailing question mark.

Mentioned in SAL (#wikimedia-operations) [2017-06-29T21:00:52Z] <mobrovac@tin> Started deploy [restbase/deploy@bcb83f4]: Fix special char handling in PDF back-end requests - T169223

Mentioned in SAL (#wikimedia-operations) [2017-06-29T21:04:07Z] <mobrovac@tin> Finished deploy [restbase/deploy@bcb83f4]: Fix special char handling in PDF back-end requests - T169223 (duration: 03m 14s)

mobrovac closed this task as Resolved.Jun 29 2017, 9:21 PM
mobrovac assigned this task to GWicke.
mobrovac edited projects, added Services (done); removed Services (next).
mobrovac added a subscriber: mobrovac.

Fix deployed, checked in production, works.