dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
API: Add license info to API help output
[lhc/web/wiklou.git]
/
includes
/
MovePage.php
diff --git
a/includes/MovePage.php
b/includes/MovePage.php
index
065e189
..
de7da3f
100644
(file)
--- a/
includes/MovePage.php
+++ b/
includes/MovePage.php
@@
-159,6
+159,7
@@
class MovePage {
protected function isValidFileMove() {
$status = new Status();
$file = wfLocalFile( $this->oldTitle );
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' );
if ( $file->exists() ) {
if ( $this->newTitle->getText() != wfStripIllegalFilenameChars( $this->newTitle->getText() ) ) {
$status->fatal( 'imageinvalidfilename' );
@@
-186,6
+187,7
@@
class MovePage {
# Is it an existing file?
if ( $this->newTitle->inNamespace( NS_FILE ) ) {
$file = wfLocalFile( $this->newTitle );
# 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;
if ( $file->exists() ) {
wfDebug( __METHOD__ . ": file exists\n" );
return false;
@@
-238,6
+240,7
@@
class MovePage {
$dbw = wfGetDB( DB_MASTER );
if ( $this->oldTitle->getNamespace() == NS_FILE ) {
$file = wfLocalFile( $this->oldTitle );
$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() ) {
if ( $file->exists() ) {
$status = $file->move( $this->newTitle );
if ( !$status->isOk() ) {
@@
-370,7
+373,10
@@
class MovePage {
$dbw->commit( __METHOD__ );
$dbw->commit( __METHOD__ );
- Hooks::run( 'TitleMoveComplete', array( &$this->oldTitle, &$this->newTitle, &$user, $pageid, $redirid, $reason ) );
+ Hooks::run(
+ 'TitleMoveComplete',
+ array( &$this->oldTitle, &$this->newTitle, &$user, $pageid, $redirid, $reason )
+ );
return Status::newGood();
}
return Status::newGood();
}