Last modified: 2013-10-28 10:08:45 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T57963, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 55963 - mediawiki.Title: Localised SVG thumbnails corrupt the newFromImg parser
mediawiki.Title: Localised SVG thumbnails corrupt the newFromImg parser
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
JavaScript (Other open bugs)
1.22.0
All All
: High critical (vote)
: 1.22.0 release
Assigned To: Nobody - You can work on this!
: code-update-regression
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-21 09:49 UTC by Krinkle
Modified: 2013-10-28 10:08 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Krinkle 2013-10-21 09:49:14 UTC
3f5d41d4135740573f642 (bug 32987) introduced support for lang= on localised SVGs.

Thumbnails are generated in this form:

[[File:Gerrit_patchset_25838_test.svg|thumb|lang=de]]

https://upload.wikimedia.org/wikipedia/commons/thumb/4/45/Gerrit_patchset_25838_test.svg/langde-345px-Gerrit_patchset_25838_test.svg.png

mw.Title.newFromImg({src:'https://upload.wikimedia.org/wikipedia/commons/thumb/4/45/Gerrit_patchset_25838_test.svg/langde-345px-Gerrit_patchset_25838_test.svg.png'});

> File:Langde-345px-Gerrit patchset 25838 test.svg.png

Since both mw.Title.newFromImg and localised SVG thumbnails are introduced recently, this is a 1.22-alpha cycle regression that must be addressed before release.
Comment 1 Jarry1250 2013-10-21 09:53:51 UTC
So to be clear, mw.Title.newFromImg() tries to recover a title object from an image filename? This should just be a case of teaching it how to handle custom language SVGs?
Comment 3 Krinkle 2013-10-21 10:02:24 UTC
(In reply to comment #1)
> So to be clear, mw.Title.newFromImg() tries to recover a title object from an
> image filename? This should just be a case of teaching it how to handle
> custom
> language SVGs?

Yes.
Comment 4 Bawolff (Brian Wolff) 2013-10-21 10:51:19 UTC
The bug here seems to be that these links are being done on the client side not the server side.

(In reply to comment #1)
> So to be clear, mw.Title.newFromImg() tries to recover a title object from an
> image filename? This should just be a case of teaching it how to handle
> custom
> language SVGs?

It should look at the directory name, not the actual filename. The format of the filename varries depending on which extensions are installed.additionally, Lonngish filenames even get shortened to things like 120px-thumbnail.jpg (change ext as appropriate). This is nothing new...
Comment 5 Gerrit Notification Bot 2013-10-21 12:49:15 UTC
Change 90897 had a related patch set uploaded by Jarry1250:
Generalise filename-matching in mediawiki.Title.newFromImg()

https://gerrit.wikimedia.org/r/90897
Comment 6 Bawolff (Brian Wolff) 2013-10-21 16:09:38 UTC
> 
> It should look at the directory name, not the actual filename. The format of
> the filename varries depending on which extensions are
> installed.additionally,
> Lonngish filenames even get shortened to things like 120px-thumbnail.jpg
> (change ext as appropriate). This is nothing new...

Specific example: https://upload.wikimedia.org/wikipedia/commons/thumb/a/a0/Geschw._Lenders%2C_Hoflieferanten%2C_Leinen-_und_W%C3%A4sche-Ausstattungsmagazin%2C_Modewaaren%2C_Allee-_und_Elberfelderstr.-Ecke_24_%28Adressbuch_der_Oberb%C3%BCrgermeisterei_D%C3%BCsseldorf_f%C3%BCr_das_Jahr_1890%2C_Erster_Theil._S._179%29.jpg/120px-thumbnail.jpg

(We do this for any file where the thumbnail is > 160 bytes)

Also I'm somewhat doubtful that [^\s\\] actually corresponds to allowed characters (U+1680 for example is allowed in files I believe).
Comment 7 Gerrit Notification Bot 2013-10-28 09:53:33 UTC
Change 90897 merged by jenkins-bot:
mediawiki.Title: Generalise filename-matching in newFromImg

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

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links