Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -114,6 +114,7 @@ |
115 | 115 | * (bug 24313) The preference to mark edits minor by default was removed, |
116 | 116 | because it encourages edits to be marked minor accidentally and it can be |
117 | 117 | easily replicated by custom user scripts for those who really want it. |
| 118 | +* Non-file pages can no longer be moved to the file namespace, nor vice versa. |
118 | 119 | |
119 | 120 | === Bug fixes in 1.17 === |
120 | 121 | * (bug 17560) Half-broken deletion moved image files to deletion archive |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -3169,6 +3169,7 @@ |
3170 | 3170 | 'immobile-source-page' => 'This page is not movable.', |
3171 | 3171 | 'immobile-target-page' => 'Cannot move to that destination title.', |
3172 | 3172 | 'imagenocrossnamespace' => 'Cannot move file to non-file namespace', |
| 3173 | +'nonfile-cannot-move-to-file' => 'Cannot move non-file to file namespace', |
3173 | 3174 | 'imagetypemismatch' => 'The new file extension does not match its type', |
3174 | 3175 | 'imageinvalidfilename' => 'The target file name is invalid', |
3175 | 3176 | 'fix-double-redirects' => 'Update any redirects that point to the original title', |
Index: trunk/phase3/includes/Title.php |
— | — | @@ -2899,11 +2899,11 @@ |
2900 | 2900 | |
2901 | 2901 | // Image-specific checks |
2902 | 2902 | if ( $this->getNamespace() == NS_FILE ) { |
| 2903 | + if ( $nt->getNamespace() != NS_FILE ) { |
| 2904 | + $errors[] = array( 'imagenocrossnamespace' ); |
| 2905 | + } |
2903 | 2906 | $file = wfLocalFile( $this ); |
2904 | 2907 | if ( $file->exists() ) { |
2905 | | - if ( $nt->getNamespace() != NS_FILE ) { |
2906 | | - $errors[] = array( 'imagenocrossnamespace' ); |
2907 | | - } |
2908 | 2908 | if ( $nt->getText() != wfStripIllegalFilenameChars( $nt->getText() ) ) { |
2909 | 2909 | $errors[] = array( 'imageinvalidfilename' ); |
2910 | 2910 | } |
— | — | @@ -2915,7 +2915,10 @@ |
2916 | 2916 | if ( !$wgUser->isAllowed( 'reupload-shared' ) && !$destfile->exists() && wfFindFile( $nt ) ) { |
2917 | 2917 | $errors[] = array( 'file-exists-sharedrepo' ); |
2918 | 2918 | } |
| 2919 | + } |
2919 | 2920 | |
| 2921 | + if ( $nt->getNamespace() == NS_FILE && $this->getNamespace() != NS_FILE ) { |
| 2922 | + $errors[] = array( 'nonfile-cannot-move-to-file' ); |
2920 | 2923 | } |
2921 | 2924 | |
2922 | 2925 | if ( $auth ) { |
Index: trunk/phase3/maintenance/language/messages.inc |
— | — | @@ -2145,6 +2145,7 @@ |
2146 | 2146 | 'immobile-target-page', |
2147 | 2147 | 'immobile_namespace', |
2148 | 2148 | 'imagenocrossnamespace', |
| 2149 | + 'nonfile-cannot-move-to-file', |
2149 | 2150 | 'imagetypemismatch', |
2150 | 2151 | 'imageinvalidfilename', |
2151 | 2152 | 'fix-double-redirects', |