Page MenuHomePhabricator

Make image saving handle urls which have percent encoding
Closed, ResolvedPublic

Description

Console errors are seen when saving enwiki > cremation.

Appears related to funky percent encoding with some image URLs for that article.

Here's one such invalid image file url:

https://en.m.wikipedia.org/wiki/File:2015-03-09Bagmati_River,_Pashupatinath,_Nepal_%E3%83%90%E3%82%B0%E3%83%9E%E3%83%86%E3%82%A3%E5%B7%9D%E3%81%A8%E3%83%91%E3%82%B7%E3%83%A5%E3%83%91%E3%83%86%E3%82%A3%E3%83%8A%E3%83%BC%E3%83%88%E7%81%AB%E8%91%AC%E5%A0%B4DSCF6170%E2%98%86%E5%BD%A1.JPG

Removing percent encoding in WMFImageTag.m makes the urls work. The one above resolves to this:

https://en.m.wikipedia.org/wiki/File:2015-03-09Bagmati_River,_Pashupatinath,_Nepal_バグマティ川とパシュパティナート火葬場DSCF6170☆彡.JPG

...but migrateLegacyImagesInArticle fails because of nulls... so we may need to poke around a bit. Joe suggested considering maybe hashing the urls to figure out the local filenames.

Event Timeline

Mhurd updated the task description. (Show Details)
Mhurd added a subscriber: JoeWalsh.
cmadeo triaged this task as Medium priority.Jan 29 2018, 7:12 PM
JMinor lowered the priority of this task from Medium to Low.Feb 27 2018, 7:32 PM
JMinor subscribed.

Per meeting @Mhurd please retest as @JoeWalsh made some other changes that should have fixed this.

@JMinor

I retested and no longer see the error message.

I also tested that all the images for the article were correctly saved. After going offline and doing cold app start all of the images for that article were present.