Index: trunk/extensions/TitleBlacklist/TitleBlacklist.hooks.php |
— | — | @@ -54,7 +54,11 @@ |
55 | 55 | public static function verifyUpload( $fname, $fpath, &$err ) { |
56 | 56 | global $wgTitleBlacklist; |
57 | 57 | efInitTitleBlacklist(); |
58 | | - $blacklisted = $wgTitleBlacklist->isBlacklisted( Title::newFromText( $fname, NS_IMAGE ), 'upload' ); |
| 58 | + |
| 59 | + $title = Title::newFromText( $fname, NS_IMAGE ); |
| 60 | + $action = $title->exists() ? 'reupload' : 'upload'; |
| 61 | + |
| 62 | + $blacklisted = $wgTitleBlacklist->isBlacklisted( $title, $action ); |
59 | 63 | if( $blacklisted instanceof TitleBlacklistEntry ) { |
60 | 64 | wfLoadExtensionMessages( 'TitleBlacklist' ); |
61 | 65 | $message = $blacklisted->getCustomMessage(); |
Index: trunk/extensions/TitleBlacklist/TitleBlacklist.list.php |
— | — | @@ -209,6 +209,9 @@ |
210 | 210 | if( !isset( $this->mParams['noedit'] ) && $action == 'edit' ) { |
211 | 211 | return true; |
212 | 212 | } |
| 213 | + if ( isset( $this->mParams['reupload'] ) && $action == 'reupload' ) { |
| 214 | + return true; |
| 215 | + } |
213 | 216 | return false; |
214 | 217 | } |
215 | 218 | return true; |
— | — | @@ -240,6 +243,9 @@ |
241 | 244 | if( $opt2 == 'casesensitive' ) { |
242 | 245 | $options['casesensitive'] = true; |
243 | 246 | } |
| 247 | + if( $opt2 == 'reupload' ) { |
| 248 | + $options['reupload'] = true; |
| 249 | + } |
244 | 250 | if( preg_match( '/errmsg\s*=\s*(.+)/i', $opt, $matches ) ) { |
245 | 251 | $options['errmsg'] = $matches[1]; |
246 | 252 | } |