return true;
}
- /** Misc variables **/
+ /** Misc variables */
/** @var WebRequest|FauxRequest The request this form is supposed to handle */
public $mRequest;
public $mLocalFile;
public $mUploadClicked;
- /** User input variables from the "description" section **/
+ /** User input variables from the "description" section */
/** @var string The requested target file name */
public $mDesiredDestName;
public $mComment;
public $mLicense;
- /** User input variables from the root section **/
+ /** User input variables from the root section */
public $mIgnoreWarning;
public $mWatchthis;
public $mCopyrightStatus;
public $mCopyrightSource;
- /** Hidden variables **/
+ /** Hidden variables */
public $mDestWarningAck;
/** @var bool Subclasses can use this to determine whether a file was uploaded */
public $mUploadSuccessful = false;
- /** Text injection points for hooks not using HTMLForm **/
+ /** Text injection points for hooks not using HTMLForm */
public $uploadFormTextTop;
public $uploadFormTextAfterSummary;
$this->loadRequest();
# Unsave the temporary file in case this was a cancelled upload
- if ( $this->mCancelUpload ) {
- if ( !$this->unsaveUploadedFile() ) {
- # Something went wrong, so unsaveUploadedFile showed a warning
- return;
- }
+ if ( $this->mCancelUpload && !$this->unsaveUploadedFile() ) {
+ # Something went wrong, so unsaveUploadedFile showed a warning
+ return;
}
# Process upload or show a form
return true;
}
- $local = wfLocalFile( $this->mDesiredDestName );
+ $local = MediaWikiServices::getInstance()->getRepoGroup()->getLocalRepo()
+ ->newFile( $this->mDesiredDestName );
if ( $local && $local->exists() ) {
// We're uploading a new version of an existing file.
// No creation, so don't watch it if we're not already.
*/
protected function processVerificationError( $details ) {
switch ( $details['status'] ) {
- /** Statuses that only require name changing **/
+ /** Statuses that only require name changing */
case UploadBase::MIN_LENGTH_PARTNAME:
$this->showRecoverableUploadError( $this->msg( 'minlength1' )->escaped() );
break;
$this->showRecoverableUploadError( $this->msg( 'windows-nonascii-filename' )->parse() );
break;
- /** Statuses that require reuploading **/
+ /** Statuses that require reuploading */
case UploadBase::EMPTY_FILE:
$this->showUploadError( $this->msg( 'emptyfile' )->escaped() );
break;
}
}
- /*** Functions for formatting warnings ***/
+ /** Functions for formatting warnings */
/**
* Formats a result of UploadBase::getExistsWarning as HTML