Index: trunk/phase3/includes/upload/UploadBase.php |
— | — | @@ -473,7 +473,7 @@ |
474 | 474 | |
475 | 475 | $overwriteError = $this->checkOverwrite( $user ); |
476 | 476 | if ( $overwriteError !== true ) { |
477 | | - return array( array( $overwriteError ) ); |
| 477 | + return array( $overwriteError ); |
478 | 478 | } |
479 | 479 | |
480 | 480 | return true; |
— | — | @@ -1101,14 +1101,14 @@ |
1102 | 1102 | * |
1103 | 1103 | * @param $user User |
1104 | 1104 | * |
1105 | | - * @return mixed true on success, error string on failure |
| 1105 | + * @return mixed true on success, array on failure |
1106 | 1106 | */ |
1107 | 1107 | private function checkOverwrite( $user ) { |
1108 | 1108 | // First check whether the local file can be overwritten |
1109 | 1109 | $file = $this->getLocalFile(); |
1110 | 1110 | if( $file->exists() ) { |
1111 | 1111 | if( !self::userCanReUpload( $user, $file ) ) { |
1112 | | - return 'fileexists-forbidden'; |
| 1112 | + return array( 'fileexists-forbidden', $file->getName() ); |
1113 | 1113 | } else { |
1114 | 1114 | return true; |
1115 | 1115 | } |
— | — | @@ -1119,7 +1119,7 @@ |
1120 | 1120 | */ |
1121 | 1121 | $file = wfFindFile( $this->getTitle() ); |
1122 | 1122 | if ( $file && !$user->isAllowed( 'reupload-shared' ) ) { |
1123 | | - return 'fileexists-shared-forbidden'; |
| 1123 | + return array( 'fileexists-shared-forbidden', $file->getName() ); |
1124 | 1124 | } |
1125 | 1125 | |
1126 | 1126 | return true; |
Index: trunk/phase3/includes/specials/SpecialUpload.php |
— | — | @@ -455,8 +455,8 @@ |
456 | 456 | $permErrors = $this->mUpload->verifyPermissions( $wgUser ); |
457 | 457 | if( $permErrors !== true ) { |
458 | 458 | $code = array_shift( $permErrors[0] ); |
459 | | - $this->showRecoverableUploadError( wfMsgExt( $code, |
460 | | - 'parseinline', $permErrors[0] ) ); |
| 459 | + $this->showRecoverableUploadError( wfMsgExt( $code[0], |
| 460 | + 'parseinline', $code[1] ) ); |
461 | 461 | return; |
462 | 462 | } |
463 | 463 | |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -191,7 +191,9 @@ |
192 | 192 | * Do not show enotifminoredits preference, if disabled by $wgEnotifMinorEdits. |
193 | 193 | * AbortLogin returning "ABORTED" now handled. Also allows message identifier |
194 | 194 | for "ABORTED" reason to be returned and displayed to user. |
195 | | - |
| 195 | +* (bug 28034) uploading file to local wiki when file exists on shared repository |
| 196 | + (commons) gives spurious info in the warning message |
| 197 | + |
196 | 198 | === API changes in 1.18 === |
197 | 199 | * (bug 26339) Throw warning when truncating an overlarge API result |
198 | 200 | * (bug 14869) Add API module for accessing QueryPage-based special pages |