From: Bartosz DziewoƄski Date: Tue, 31 May 2016 22:40:15 +0000 (+0200) Subject: mw.Title: Correct order of file URL regexes in newFromImg X-Git-Tag: 1.31.0-rc.0~6747^2 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=9df363dbbfd4ead14807483246b19348620a85c4;p=lhc%2Fweb%2Fwiklou.git mw.Title: Correct order of file URL regexes in newFromImg The "Thumbnails in non-hashed upload directories" regex can match non-thumbnailed files in hashed directories if the file name contains the word "thumbnail" or the first two bytes of the MD5 hash of the file name. We should check "Full size images" first. Bug: T134860 Change-Id: I74af47969bf9ba204c24e299f788f5349302e437 --- diff --git a/resources/src/mediawiki/mediawiki.Title.js b/resources/src/mediawiki/mediawiki.Title.js index 68595926a7..ff4d1c20cb 100644 --- a/resources/src/mediawiki/mediawiki.Title.js +++ b/resources/src/mediawiki/mediawiki.Title.js @@ -664,12 +664,12 @@ // Thumbnails /\/[a-f0-9]\/[a-f0-9]{2}\/([^\s\/]+)\/[^\s\/]+-[^\s\/]*$/, - // Thumbnails in non-hashed upload directories - /\/([^\s\/]+)\/[^\s\/]+-(?:\1|thumbnail)[^\s\/]*$/, - // Full size images /\/[a-f0-9]\/[a-f0-9]{2}\/([^\s\/]+)$/, + // Thumbnails in non-hashed upload directories + /\/([^\s\/]+)\/[^\s\/]+-(?:\1|thumbnail)[^\s\/]*$/, + // Full-size images in non-hashed upload directories /\/([^\s\/]+)$/ ],