$this->mUploadDescription,
$this->mUploadCopyStatus,
$this->mUploadSource );
+
+ /* refresh image metadata cache */
+ new Image( $this->mUploadSaveName, true );
+
$this->showSuccess();
}
}
if( is_file( $this->mSavedFile ) ) {
$this->mUploadOldVersion = gmdate( 'YmdHis' ) . "!{$saveName}";
+ wfSuppressWarnings();
+ $success = rename( $this->mSavedFile, "${archive}/{$this->mUploadOldVersion}" );
+ wfRestoreWarnings();
- if( !rename( $this->mSavedFile, "${archive}/{$this->mUploadOldVersion}" ) ) {
+ if( ! $success ) {
$wgOut->fileRenameError( $this->mSavedFile,
"${archive}/{$this->mUploadOldVersion}" );
return false;
}
if( $useRename ) {
- if( !rename( $tempName, $this->mSavedFile ) ) {
+ wfSuppressWarnings();
+ $success = rename( $tempName, $this->mSavedFile );
+ wfRestoreWarnings();
+
+ if( ! $success ) ) {
$wgOut->fileCopyError( $tempName, $this->mSavedFile );
return false;
}
} else {
- if( !move_uploaded_file( $tempName, $this->mSavedFile ) ) {
+ wfSuppressWarnings();
+ $success = move_uploaded_file( $tempName, $this->mSavedFile );
+ wfRestoreWarnings();
+
+ if( ! $success ) {
$wgOut->fileCopyError( $tempName, $this->mSavedFile );
return false;
}
* @access private
*/
function saveTempUploadedFile( $saveName, $tempName ) {
- global $wgOut;
-
+ global $wgOut;
$archive = wfImageArchiveDir( $saveName, 'temp' );
$stash = $archive . '/' . gmdate( "YmdHis" ) . '!' . $saveName;
* @return int
* @access private
*/
- function stashSession() {
+ function stashSession() {
$stash = $this->saveTempUploadedFile(
$this->mUploadSaveName, $this->mUploadTempName );
* @access private
*/
function unsaveUploadedFile() {
- if ( ! @unlink( $this->mUploadTempName ) ) {
+ wfSuppressWarnings();
+ $success = unlink( $this->mUploadTempName );
+ wfRestoreWarnings();
+ if ( ! $success ) {
$wgOut->fileDeleteError( $this->mUploadTempName );
}
}
return true;
}
- $data = @getimagesize( $tmpfile );
+ wfSuppressWarnings();
+ $data = getimagesize( $tmpfile );
+ wfRestoreWarnings();
if( false === $data ) {
# Didn't recognize the image type.
# Either the image is corrupt or someone's slipping us some