Index: trunk/phase3/includes/SpecialUpload.php |
— | — | @@ -284,16 +284,17 @@ |
285 | 285 | |
286 | 286 | # Chop off any directories in the given filename |
287 | 287 | if( $this->mDesiredDestName ) { |
288 | | - $basename = wfBaseName( $this->mDesiredDestName ); |
| 288 | + $basename = $this->mDesiredDestName; |
289 | 289 | } else { |
290 | | - $basename = wfBaseName( $this->mSrcName ); |
| 290 | + $basename = $this->mSrcName; |
291 | 291 | } |
| 292 | + $filtered = wfBaseName( $basename ); |
292 | 293 | |
293 | 294 | /** |
294 | 295 | * We'll want to blacklist against *any* 'extension', and use |
295 | 296 | * only the final one for the whitelist. |
296 | 297 | */ |
297 | | - list( $partname, $ext ) = $this->splitExtensions( $basename ); |
| 298 | + list( $partname, $ext ) = $this->splitExtensions( $filtered ); |
298 | 299 | |
299 | 300 | if( count( $ext ) ) { |
300 | 301 | $finalExt = $ext[count( $ext ) - 1]; |
— | — | @@ -317,7 +318,7 @@ |
318 | 319 | * Filter out illegal characters, and try to make a legible name |
319 | 320 | * out of it. We'll strip some silently that Title would die on. |
320 | 321 | */ |
321 | | - $filtered = preg_replace ( "/[^".Title::legalChars()."]|:/", '-', $basename ); |
| 322 | + $filtered = preg_replace ( "/[^".Title::legalChars()."]|:/", '-', $filtered ); |
322 | 323 | $nt = Title::makeTitleSafe( NS_IMAGE, $filtered ); |
323 | 324 | if( is_null( $nt ) ) { |
324 | 325 | $this->uploadError( wfMsgWikiHtml( 'illegalfilename', htmlspecialchars( $filtered ) ) ); |
— | — | @@ -388,7 +389,7 @@ |
389 | 390 | if( $wgCapitalLinks ) { |
390 | 391 | $filtered = ucfirst( $filtered ); |
391 | 392 | } |
392 | | - if( $this->mDestName != $filtered ) { |
| 393 | + if( $basename != $filtered ) { |
393 | 394 | $warning .= '<li>'.wfMsgHtml( 'badfilename', htmlspecialchars( $this->mDestName ) ).'</li>'; |
394 | 395 | } |
395 | 396 | |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -315,8 +315,8 @@ |
316 | 316 | * (bug 10615) Fix for transwiki import when CURL not available |
317 | 317 | * (bug 8054) Return search page for empty search requests with ugly URLs |
318 | 318 | * (bug 10572) Force refresh after clearing visitation timestamps on watchlist |
| 319 | +* (bug 10631) Warn when illegal characters are removed from filename at upload |
319 | 320 | |
320 | | - |
321 | 321 | == API changes since 1.10 == |
322 | 322 | |
323 | 323 | Full API documentation is available at http://www.mediawiki.org/wiki/API |