Index: trunk/extensions/UploadWizard/resources/jquery/jquery.validate.wmCommonsBlacklist.js |
— | — | @@ -1,11 +1,10 @@ |
2 | 2 | /** |
3 | | - * One day this will look up an API method to determine if a filename is blacklisted by your local MediaWiki |
4 | | - * For now we check with some regexes locally, with a Commons-specific blacklist |
5 | | - * This is an incomplete rendering of the meta.wikimedia.org and commons.wikimedia.org blacklist as they existed on 2011-05-05, and |
| 3 | + * Does some local checking of a file. For more specific filenames (such as bad words, other blacklisted stuff) use |
| 4 | + * the Blacklist API. |
| 5 | + * |
| 6 | + * This is an incomplete rendering of some of the meta.wikimedia.org and commons.wikimedia.org blacklist as they existed on 2011-05-05, and |
6 | 7 | * ignores cases that are irrelevant to uploading new media images. |
7 | 8 | * - all regexes are case INsensitive by default |
8 | | - * - casesensitive is considered |
9 | | - * - errmsg is considered |
10 | 9 | * - namespaces and File: prefix are removed since everything we upload is under File: anyway |
11 | 10 | * - noedit, moveonly, repuload is irrelevant |
12 | 11 | * - we can't check autoconfirmed-ness of users here, so we ignore it |
— | — | @@ -15,34 +14,7 @@ |
16 | 15 | ( function( $ ) { |
17 | 16 | |
18 | 17 | var regexSets = { |
19 | | - |
20 | | - 'titleBlacklist': [ |
21 | | - /(?:suck|his|your|my) penis/i, |
22 | | - /\bnimp\.org./i, |
23 | | - /Lawl,/i, |
24 | | - /HAGG[EA]R[^A-Z]*/i, |
25 | | - /[НHΗ][EЕΕ]R[MМΜ][YΥ]/, |
26 | | - /[НHΗ][AΑΑ]GG[EЕΕ]R/, |
27 | | - /[НH]\W*[AΑΑ]\W*G\W*G\W*[EЕΕ]\W*R(?!ston)/i, |
28 | | - /\bHERMY/, |
29 | | - / on wheels/i, |
30 | | - /(?:.*?\/)?index\.php(?:\/.*)?/i, |
31 | | - /(?:http|https|ftp|mailto|torrent|ed2k)\:\/\/[\w\d:@\-]+\.[\w\d\-]+/i, |
32 | | - /http:\/\//i, |
33 | | - /\/wiki\//i, |
34 | | - /\bis\s+(?:a|an)\s+(?:dick|cunt|fag|bitch|shit|fuck|fucker|loser|ass|gay|ghey|moron|retard|stupid|slut|pa?edo)/i, |
35 | | - /\sprefix:/i, // search from inputboxes (f.e. in the village pumps) |
36 | | - /.*[!?]{3,}.* /i, |
37 | | - /(?:[^\/i]+[\/:])?(index\.php|w\/wiki)(?:\/.+)?/, |
38 | | - /[НHΗHⱧ][EЕΕËEĖ][RRЯ][MМΜM][YΥY]/i, |
39 | | - /JEWS DID/i, |
40 | | - /ON WHE/, |
41 | | - /(?:Moulton|Barsoom Tork|Pocoyo Albatross|Anything Muppets|Moosey Mouse|Inbloomed Muppets).*/, |
42 | | - /Jorge Queirolo Bravo/i, |
43 | | - /Vasilisa(\d)+/i, |
44 | | - /google.*\.html/i |
45 | | - ], |
46 | | - |
| 18 | + |
47 | 19 | 'titleBadchars': [ |
48 | 20 | /[\u00A0\u1680\u180E\u2000-\u200B\u2028\u2029\u202F\u205F\u3000]/, // NBSP and other unusual spaces |
49 | 21 | /[\u202A-\u202E]/, // BiDi overrides |
— | — | @@ -74,23 +46,6 @@ |
75 | 47 | /^SANY[\d\s]+$/ // Sanyo |
76 | 48 | ], |
77 | 49 | |
78 | | - // filename from elsewhere |
79 | | - 'titleHosting': [ |
80 | | - /^\d{9}[A-Z]{6}_[A-Z]{2}[^A-Za-z]*$/, // some image hosting site? |
81 | | - /^\d{8,}_[\dA-F]{10}(_[A-Z])?[^A-Za-z]*$/i, // http://www.flickr.com/services/api/misc.urls.html/i, |
82 | | - /^([\dA-F]{8}-)?[\dA-F]{4}-[\dA-F]{4}-[\dA-F]{4}-?[\dA-F]{12}.*$/, // [[w:UUID]] (with some variations included) |
83 | | - /^([SML]|\d+)_[\dA-F]{10,}(-\d+-|_?(\w\w?|full))?$/, // L_9173c67eae58edc35ba7f2df08a7d5c6.jpg, 2421601587_abaf4e3e81.jpg, 1_bf38bcd9c5512a5ab99ca2219a4b1e2f_full.gif, etc. |
84 | | - /^AT[AEIMQUYcgkosw048]AAA[A-D][-_A-Za-z0-9]+$/, // see Commons:Village pump#File ATgAAA... (Jan 20, 2009, full link in edit comment) |
85 | | - /^(\d+_){2,}[qtsn]$/, // Facebook: \d+_\d+_(\d+)_(\d+)_\d+_[qtsn]\.jpg -> photo.php?id=$1&pid=$2 |
86 | | - /^[qtsn]\d+(_\d+)+$/, // Facebook (older?): [qtsn](\d+)_(\d+)_\d+\.jpg -> photo.php?id=$1&pid=$2 |
87 | | - /^Tumblr_[a-z\d]{19}_\d$/, // Tumblr |
88 | | - /^File$/, |
89 | | - /^[^A-Za-z]*(small|medium|large)\)?$/, |
90 | | - /^(Untitled|No[-_]?name|Picture|Pict?|Image[mn]?|Img|Immagine|Photo|Foto|Bild|Scan|Panorama|Sin_título)[^A-Za-z]*$/, |
91 | | - /^(January|Jan|February|Febr?|March|Mar|April|Apr|May|June?|July?|August|Aug|September|Sept?|October|Oct|November|Nov|December|Dec)[^A-Za-z]*$/, |
92 | | - /^[0-9 ]*([A-Z][0-9 ]*){30,}$/ |
93 | | - ], |
94 | | - |
95 | 50 | 'titleThumbnail': [ |
96 | 51 | /^\d+px-.*/ |
97 | 52 | ], |
Index: trunk/extensions/UploadWizard/resources/mw.UploadWizardDetails.js |
— | — | @@ -273,18 +273,14 @@ |
274 | 274 | _this.$form.find( '.mwe-title' ) |
275 | 275 | .rules( "add", { |
276 | 276 | required: true, |
277 | | - titleBlacklist: true, |
278 | 277 | titleBadchars: true, |
279 | 278 | titleSenselessimagename: true, |
280 | | - titleHosting: true, |
281 | 279 | titleThumbnail: true, |
282 | 280 | titleExtension: true, |
283 | 281 | messages: { |
284 | 282 | required: gM( 'mwe-upwiz-error-blank' ), |
285 | | - titleBlacklist: gM( 'mwe-upwiz-error-title-blacklisted' ), |
286 | 283 | titleBadchars: gM( 'mwe-upwiz-error-title-badchars' ), |
287 | 284 | titleSenselessimagename: gM( 'mwe-upwiz-error-title-senselessimagename' ), |
288 | | - titleHosting: gM( 'mwe-upwiz-error-title-hosting' ), |
289 | 285 | titleThumbnail: gM( 'mwe-upwiz-error-title-thumbnail' ), |
290 | 286 | titleExtension: gM( 'mwe-upwiz-error-title-extension' ) |
291 | 287 | } |