Index: trunk/extensions/ConfirmAccount/RequestAccount_body.php |
— | — | @@ -329,7 +329,7 @@ |
330 | 330 | return false; |
331 | 331 | } |
332 | 332 | $veri = $this->verify( $this->mTempPath, $finalExt ); |
333 | | - if ( $veri !== true ) { |
| 333 | + if ( !$veri->isGood() ) { |
334 | 334 | $this->mPrevAttachment = ''; |
335 | 335 | $this->showForm( wfMsgHtml( 'uploadcorrupt' ) ); |
336 | 336 | return false; |
— | — | @@ -439,7 +439,7 @@ |
440 | 440 | * |
441 | 441 | * @param string $tmpfile the full path of the temporary file to verify |
442 | 442 | * @param string $extension The filename extension that the file is to be served with |
443 | | - * @return mixed true of the file is verified, a WikiError object otherwise. |
| 443 | + * @return Status object |
444 | 444 | */ |
445 | 445 | protected function verify( $tmpfile, $extension ) { |
446 | 446 | # magically determine mime type |
— | — | @@ -451,18 +451,18 @@ |
452 | 452 | wfDebug ( "\n\nmime: <$mime> extension: <$extension>\n\n" ); |
453 | 453 | # check mime type against file extension |
454 | 454 | if ( !UploadBase::verifyExtension( $mime, $extension ) ) { |
455 | | - return new WikiErrorMsg( 'uploadcorrupt' ); |
| 455 | + return Status::newFatal( 'uploadcorrupt' ); |
456 | 456 | } |
457 | 457 | |
458 | 458 | # check mime type blacklist |
459 | 459 | global $wgMimeTypeBlacklist; |
460 | 460 | if ( isset( $wgMimeTypeBlacklist ) && !is_null( $wgMimeTypeBlacklist ) |
461 | 461 | && $this->checkFileExtension( $mime, $wgMimeTypeBlacklist ) ) { |
462 | | - return new WikiErrorMsg( 'filetype-badmime', htmlspecialchars( $mime ) ); |
| 462 | + return Status::newFatal( 'filetype-badmime', $mime ); |
463 | 463 | } |
464 | 464 | } |
465 | 465 | wfDebug( __METHOD__ . ": all clear; passing.\n" ); |
466 | | - return true; |
| 466 | + return Status::newGood(); |
467 | 467 | } |
468 | 468 | |
469 | 469 | /** |