* (bug 28287) The "your changes" box for edit conflicts is now read-only.
* (bug 28940) When making a thumb of an SVG, and only specifying the height
make the width be the max SVG size, not the natrual width of the SVG.
+* (bug 1780) Uploading files with non-ascii characters are now forbidden on
+ Windows.
=== API changes in 1.19 ===
* (bug 27790) add query type for querymodules to action=paraminfo
case UploadBase::FILETYPE_MISSING:
$this->dieRecoverableError( 'filetype-missing', 'filename' );
break;
+ case UploadBase::WINDOWS_NONASCII_FILENAME:
+ $this->dieRecoverableError( 'windows-nonascii-filename', 'filename' );
+ break;
// Unrecoverable errors
case UploadBase::EMPTY_FILE:
$this->showRecoverableUploadError( wfMsgExt( 'filetype-missing',
'parseinline' ) );
break;
+ case UploadBase::WINDOWS_NONASCII_FILENAME:
+ $this->showRecoverableUploadError( wfMsgExt( 'windows-nonascii-filename',
+ 'parseinline' ) );
+ break;
/** Statuses that require reuploading **/
case UploadBase::EMPTY_FILE:
const UPLOAD_VERIFICATION_ERROR = 11;
const HOOK_ABORTED = 11;
const FILE_TOO_LARGE = 12;
+ const WINDOWS_NONASCII_FILENAME = 13;
const SESSION_VERSION = 2;
const SESSION_KEYNAME = 'wsUploadData';
self::OVERWRITE_EXISTING_FILE => 'overwrite',
self::VERIFICATION_ERROR => 'verification-error',
self::HOOK_ABORTED => 'hookaborted',
+ self::WINDOWS_NONASCII_FILENAME => 'windows-nonascii-filename',
);
if( isset( $code_to_status[$error] ) ) {
return $code_to_status[$error];
$this->mTitleError = self::FILETYPE_BADTYPE;
return $this->mTitle = null;
}
+
+ // Windows may be broken with special characters, see bug XXX
+ if ( wfIsWindows() && !preg_match( '/^[\x0-\x7f]*$/', $nt->getText() ) ) {
+ $this->mTitleError = self::WINDOWS_NONASCII_FILENAME;
+ return $this->mTitle = null;
+ }
# If there was more than one "extension", reassemble the base
# filename to prevent bogus complaints about length
'file-exists-duplicate' => 'This file is a duplicate of the following {{PLURAL:$1|file|files}}:',
'file-deleted-duplicate' => "A file identical to this file ([[:$1]]) has previously been deleted.
You should check that file's deletion history before proceeding to re-upload it.",
+'windows-nonascii-filename' => 'The server does not support filenames with special characters.',
'uploadwarning' => 'Upload warning',
'uploadwarning-text' => 'Please modify the file description below and try again.',
'savefile' => 'Save file',
'large-file',
'largefileserver',
'emptyfile',
+ 'windows-nonascii-filename',
'fileexists',
'filepageexists',
'fileexists-extension',