Index: trunk/phase3/includes/specials/SpecialUpload.php |
— | — | @@ -550,7 +550,7 @@ |
551 | 551 | $warning .= self::getExistsWarning( $this->mLocalFile ); |
552 | 552 | } |
553 | 553 | |
554 | | - $warning .= $this->getDupeWarning( $this->mTempPath, $finalExt ); |
| 554 | + $warning .= $this->getDupeWarning( $this->mTempPath, $finalExt, $nt ); |
555 | 555 | |
556 | 556 | if( $warning != '' ) { |
557 | 557 | /** |
— | — | @@ -757,7 +757,7 @@ |
758 | 758 | * Check for duplicate files and throw up a warning before the upload |
759 | 759 | * completes. |
760 | 760 | */ |
761 | | - function getDupeWarning( $tempfile, $extension ) { |
| 761 | + function getDupeWarning( $tempfile, $extension, $destinationTitle ) { |
762 | 762 | $hash = File::sha1Base36( $tempfile ); |
763 | 763 | $dupes = RepoGroup::singleton()->findBySha1( $hash ); |
764 | 764 | $archivedImage = new ArchivedFile( null, 0, $hash.".$extension" ); |
— | — | @@ -766,8 +766,12 @@ |
767 | 767 | $msg = "<gallery>"; |
768 | 768 | foreach( $dupes as $file ) { |
769 | 769 | $title = $file->getTitle(); |
770 | | - $msg .= $title->getPrefixedText() . |
771 | | - "|" . $title->getText() . "\n"; |
| 770 | + # Don't throw the warning when the titles are the same, it's a reupload |
| 771 | + # and highly redundant. |
| 772 | + if ( !$title->equals( $destinationTitle ) || !$this->mIsReUpload ) { |
| 773 | + $msg .= $title->getPrefixedText() . |
| 774 | + "|" . $title->getText() . "\n"; |
| 775 | + } |
772 | 776 | } |
773 | 777 | $msg .= "</gallery>"; |
774 | 778 | return "<li>" . |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -106,6 +106,8 @@ |
107 | 107 | * (bug 15391) catch DBQueryErrors on external storage insertion. This avoids error |
108 | 108 | messages on save were the edit in fact is saved. |
109 | 109 | * (bug 17184) Remove duplicate "z" accesskey in MonoBook |
| 110 | +* Remove redundant dupe warnings on reupload for the same title. Dupe warnings |
| 111 | + for identical files at different titles are still given. |
110 | 112 | |
111 | 113 | == API changes in 1.15 == |
112 | 114 | * (bug 16858) Revamped list=deletedrevs to make listing deleted contributions |