Index: trunk/extensions/SocialProfile/SystemGifts/SpecialSystemGiftManagerLogo.php |
— | — | @@ -183,8 +183,8 @@ |
184 | 184 | if ( !$this->mStashed ) { |
185 | 185 | $veri = $this->verify( $this->mUploadTempName, $finalExt ); |
186 | 186 | |
187 | | - if ( $veri !== true ) { // it's a wiki error... |
188 | | - return $this->uploadError( $veri->toString() ); |
| 187 | + if ( !$veri->isGood() ) { |
| 188 | + return $this->uploadError( $wgOut->parse( $veri->getWikiText() ) ); |
189 | 189 | } |
190 | 190 | } |
191 | 191 | |
— | — | @@ -663,7 +663,7 @@ |
664 | 664 | * |
665 | 665 | * @param string $tmpfile the full path opf the temporary file to verify |
666 | 666 | * @param string $extension The filename extension that the file is to be served with |
667 | | - * @return mixed true of the file is verified, a WikiError object otherwise. |
| 667 | + * @return Status object |
668 | 668 | */ |
669 | 669 | function verify( $tmpfile, $extension ) { |
670 | 670 | # magically determine mime type |
— | — | @@ -675,20 +675,20 @@ |
676 | 676 | if ( $wgVerifyMimeType ) { |
677 | 677 | # check mime type against file extension |
678 | 678 | if ( !$this->verifyExtension( $mime, $extension ) ) { |
679 | | - return new WikiErrorMsg( 'uploadcorrupt' ); |
| 679 | + return Status::newFatal( 'uploadcorrupt' ); |
680 | 680 | } |
681 | 681 | |
682 | 682 | # check mime type blacklist |
683 | 683 | global $wgMimeTypeBlacklist; |
684 | 684 | if ( isset( $wgMimeTypeBlacklist ) && !is_null( $wgMimeTypeBlacklist ) |
685 | 685 | && $this->checkFileExtension( $mime, $wgMimeTypeBlacklist ) ) { |
686 | | - return new WikiErrorMsg( 'badfiletype', htmlspecialchars( $mime ) ); |
| 686 | + return Status::newFatal( 'badfiletype', htmlspecialchars( $mime ) ); |
687 | 687 | } |
688 | 688 | } |
689 | 689 | |
690 | 690 | # check for htmlish code and javascript |
691 | 691 | if ( $this->detectScript( $tmpfile, $mime ) ) { |
692 | | - return new WikiErrorMsg( 'uploadscripted' ); |
| 692 | + return Status::newFatal( 'uploadscripted' ); |
693 | 693 | } |
694 | 694 | |
695 | 695 | /** |
— | — | @@ -696,11 +696,11 @@ |
697 | 697 | */ |
698 | 698 | $virus = $this->detectVirus( $tmpfile ); |
699 | 699 | if ( $virus ) { |
700 | | - return new WikiErrorMsg( 'uploadvirus', htmlspecialchars( $virus ) ); |
| 700 | + return Status::newFatal( 'uploadvirus', htmlspecialchars( $virus ) ); |
701 | 701 | } |
702 | 702 | |
703 | 703 | wfDebug( __METHOD__ . ": all clear; passing.\n" ); |
704 | | - return true; |
| 704 | + return Status::newGood(); |
705 | 705 | } |
706 | 706 | |
707 | 707 | /** |
Index: trunk/extensions/SocialProfile/UserGifts/SpecialGiftManagerLogo.php |
— | — | @@ -186,8 +186,8 @@ |
187 | 187 | if ( !$this->mStashed ) { |
188 | 188 | $veri = $this->verify( $this->mUploadTempName, $finalExt ); |
189 | 189 | |
190 | | - if ( $veri !== true ) { // it's a wiki error... |
191 | | - return $this->uploadError( $veri->toString() ); |
| 190 | + if ( !$veri->isGood() ) { |
| 191 | + return $this->uploadError( $wgOut->parse( $veri->getWikiText() ) ); |
192 | 192 | } |
193 | 193 | } |
194 | 194 | |
— | — | @@ -651,7 +651,7 @@ |
652 | 652 | * |
653 | 653 | * @param string $tmpfile the full path opf the temporary file to verify |
654 | 654 | * @param string $extension The filename extension that the file is to be served with |
655 | | - * @return mixed true of the file is verified, a WikiError object otherwise. |
| 655 | + * @return Status object |
656 | 656 | */ |
657 | 657 | function verify( $tmpfile, $extension ) { |
658 | 658 | # magically determine mime type |
— | — | @@ -664,20 +664,20 @@ |
665 | 665 | |
666 | 666 | # check mime type against file extension |
667 | 667 | if ( !$this->verifyExtension( $mime, $extension ) ) { |
668 | | - return new WikiErrorMsg( 'uploadcorrupt' ); |
| 668 | + return Status::newFatal( 'uploadcorrupt' ); |
669 | 669 | } |
670 | 670 | |
671 | 671 | # check mime type blacklist |
672 | 672 | global $wgMimeTypeBlacklist; |
673 | 673 | if ( isset( $wgMimeTypeBlacklist ) && !is_null( $wgMimeTypeBlacklist ) |
674 | 674 | && $this->checkFileExtension( $mime, $wgMimeTypeBlacklist ) ) { |
675 | | - return new WikiErrorMsg( 'badfiletype', htmlspecialchars( $mime ) ); |
| 675 | + return Status::newFatal( 'badfiletype', htmlspecialchars( $mime ) ); |
676 | 676 | } |
677 | 677 | } |
678 | 678 | |
679 | 679 | # check for htmlish code and javascript |
680 | 680 | if ( $this->detectScript( $tmpfile, $mime ) ) { |
681 | | - return new WikiErrorMsg( 'uploadscripted' ); |
| 681 | + return Status::newFatal( 'uploadscripted' ); |
682 | 682 | } |
683 | 683 | |
684 | 684 | /** |
— | — | @@ -685,11 +685,11 @@ |
686 | 686 | */ |
687 | 687 | $virus = $this->detectVirus( $tmpfile ); |
688 | 688 | if ( $virus ) { |
689 | | - return new WikiErrorMsg( 'uploadvirus', htmlspecialchars( $virus ) ); |
| 689 | + return Status::newFatal( 'uploadvirus', htmlspecialchars( $virus ) ); |
690 | 690 | } |
691 | 691 | |
692 | 692 | wfDebug( __METHOD__ . ": all clear; passing.\n" ); |
693 | | - return true; |
| 693 | + return Status::newGood(); |
694 | 694 | } |
695 | 695 | |
696 | 696 | /** |