From 9df363dbbfd4ead14807483246b19348620a85c4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bartosz=20Dziewo=C5=84ski?= Date: Wed, 1 Jun 2016 00:40:15 +0200 Subject: [PATCH] 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 --- resources/src/mediawiki/mediawiki.Title.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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\/]+)$/ ], -- 2.20.1