r83285 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83284‎ | r83285 | r83286 >
Date:14:47, 5 March 2011
Author:btongminh
Status:ok (Comments)
Tags:
Comment:
Follow-up r83282: Re-add the lost $this->getNamespace() == NS_FILE, forgot to test the code for normal pages.
Modified paths:
  • /trunk/phase3/includes/Title.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Title.php
@@ -2986,7 +2986,13 @@
29872987 }
29882988
29892989 // Image-specific checks
2990 - $errors = array_merge( $errors, $this->validateFileMoveOperation( $nt ) );
 2990+ if ( $this->getNamespace() == NS_FILE ) {
 2991+ $errors = array_merge( $errors, $this->validateFileMoveOperation( $nt ) );
 2992+ }
 2993+
 2994+ if ( $nt->getNamespace() == NS_FILE && $this->getNamespace() != NS_FILE ) {
 2995+ $errors[] = array( 'nonfile-cannot-move-to-file' );
 2996+ }
29912997
29922998 if ( $auth ) {
29932999 $errors = wfMergeErrorArrays( $errors,
@@ -3056,10 +3062,6 @@
30573063 if ( !$wgUser->isAllowed( 'reupload-shared' ) && !$destfile->exists() && wfFindFile( $nt ) ) {
30583064 $errors[] = array( 'file-exists-sharedrepo' );
30593065 }
3060 -
3061 - if ( $nt->getNamespace() == NS_FILE && $this->getNamespace() != NS_FILE ) {
3062 - $errors[] = array( 'nonfile-cannot-move-to-file' );
3063 - }
30643066
30653067 return $errors;
30663068 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r83282Move the file related parts of Title::isValidMoveOperation to its own functio...btongminh14:44, 5 March 2011

Comments

#Comment by Aaron Schulz (talk | contribs)   16:12, 16 June 2011

Why was the 'nonfile-cannot-move-to-file' bit moved out?

#Comment by Bryan (talk | contribs)   07:57, 18 June 2011

Good question. I don't remember. In fact, I don't remember why I splitted off this code at all.

Status & tagging log