* (bug 10615) Fix for transwiki import when CURL not available
* (bug 8054) Return search page for empty search requests with ugly URLs
* (bug 10572) Force refresh after clearing visitation timestamps on watchlist
-
+* (bug 10631) Warn when illegal characters are removed from filename at upload
== API changes since 1.10 ==
# Chop off any directories in the given filename
if( $this->mDesiredDestName ) {
- $basename = wfBaseName( $this->mDesiredDestName );
+ $basename = $this->mDesiredDestName;
} else {
- $basename = wfBaseName( $this->mSrcName );
+ $basename = $this->mSrcName;
}
+ $filtered = wfBaseName( $basename );
/**
* We'll want to blacklist against *any* 'extension', and use
* only the final one for the whitelist.
*/
- list( $partname, $ext ) = $this->splitExtensions( $basename );
+ list( $partname, $ext ) = $this->splitExtensions( $filtered );
if( count( $ext ) ) {
$finalExt = $ext[count( $ext ) - 1];
* Filter out illegal characters, and try to make a legible name
* out of it. We'll strip some silently that Title would die on.
*/
- $filtered = preg_replace ( "/[^".Title::legalChars()."]|:/", '-', $basename );
+ $filtered = preg_replace ( "/[^".Title::legalChars()."]|:/", '-', $filtered );
$nt = Title::makeTitleSafe( NS_IMAGE, $filtered );
if( is_null( $nt ) ) {
$this->uploadError( wfMsgWikiHtml( 'illegalfilename', htmlspecialchars( $filtered ) ) );
if( $wgCapitalLinks ) {
$filtered = ucfirst( $filtered );
}
- if( $this->mDestName != $filtered ) {
+ if( $basename != $filtered ) {
$warning .= '<li>'.wfMsgHtml( 'badfilename', htmlspecialchars( $this->mDestName ) ).'</li>';
}