protected function isValidFileMove() {
$status = new Status();
$file = wfLocalFile( $this->oldTitle );
+ $file->load( File::READ_LATEST );
if ( $file->exists() ) {
if ( $this->newTitle->getText() != wfStripIllegalFilenameChars( $this->newTitle->getText() ) ) {
$status->fatal( 'imageinvalidfilename' );
# Is it an existing file?
if ( $this->newTitle->inNamespace( NS_FILE ) ) {
$file = wfLocalFile( $this->newTitle );
+ $file->load( File::READ_LATEST );
if ( $file->exists() ) {
wfDebug( __METHOD__ . ": file exists\n" );
return false;
$dbw = wfGetDB( DB_MASTER );
if ( $this->oldTitle->getNamespace() == NS_FILE ) {
$file = wfLocalFile( $this->oldTitle );
+ $file->load( File::READ_LATEST );
if ( $file->exists() ) {
$status = $file->move( $this->newTitle );
if ( !$status->isOk() ) {