r97987 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97986‎ | r97987 | r97988 >
Date:07:38, 24 September 2011
Author:aaron
Status:deferred
Tags:
Comment:
Fixed fatals due to WikiError being replaced with Status in core code
Modified paths:
  • /trunk/extensions/ConfirmAccount/presentation/specialpages/actions/ConfirmAccount_body.php (modified) (history)
  • /trunk/extensions/ConfirmAccount/presentation/specialpages/actions/RequestAccount_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ConfirmAccount/presentation/specialpages/actions/RequestAccount_body.php
@@ -378,9 +378,9 @@
379379 );
380380 # Send confirmation, required!
381381 $result = $this->sendConfirmationMail( $u, $token, $expires );
382 - if ( WikiError::isError( $result ) ) {
 382+ if ( !$result->isOK() ) {
383383 $dbw->rollback(); // Nevermind
384 - $error = wfMsg( 'mailerror', htmlspecialchars( $result->toString() ) );
 384+ $error = wfMsg( 'mailerror', $wgOut->parse( $result->getWikiText() ) );
385385 $this->showForm( $error );
386386 return false;
387387 }
@@ -516,7 +516,7 @@
517517 'requestaccount-email-body-admin', $name, $title->getFullUrl() );
518518 # Actually send the email...
519519 $result = UserMailer::send( $target, $source, $subject, $body );
520 - if ( WikiError::isError( $result ) ) {
 520+ if ( !$result->isOK() ) {
521521 wfDebug( "Could not sent email to admin at $target\n" );
522522 }
523523 }
@@ -582,7 +582,7 @@
583583 * @param User $user
584584 * @param string $token
585585 * @param string $expiration
586 - * @return mixed True on success, a WikiError object on failure.
 586+ * @return mixed True on success, a Status object on failure.
587587 */
588588 protected function sendConfirmationMail( $user, $token, $expiration ) {
589589 global $wgContLang;
Index: trunk/extensions/ConfirmAccount/presentation/specialpages/actions/ConfirmAccount_body.php
@@ -440,8 +440,8 @@
441441 );
442442 }
443443
444 - if( WikiError::isError( $result ) ) {
445 - $error = wfMsg( 'mailerror', htmlspecialchars( $result->toString() ) );
 444+ if( !$result->isOk() ) {
 445+ $error = wfMsg( 'mailerror', $wgOut->parse( $result->getWikiText() ) );
446446 $this->showForm( $error );
447447 return false;
448448 }
@@ -595,8 +595,8 @@
596596 // init $error
597597 $error = '';
598598
599 - if( WikiError::isError( $result ) ) {
600 - $error = wfMsg( 'mailerror', htmlspecialchars( $result->toString() ) );
 599+ if( !$result->isOK() ) {
 600+ $error = wfMsg( 'mailerror', $wgOut->parse( $result->getWikiText() ) );
601601 }
602602
603603 # Safe to hook/log now...
@@ -718,9 +718,9 @@
719719 wfMsgExt( 'confirmaccount-email-body5',
720720 array('parsemag','content'), $u->getName(), $this->reason )
721721 );
722 - if( WikiError::isError( $result ) ) {
 722+ if( !$result->isOK() ) {
723723 $dbw->rollback();
724 - $error = wfMsg( 'mailerror', htmlspecialchars( $result->toString() ) );
 724+ $error = wfMsg( 'mailerror', $wgOut->parse( $result->getWikiText() ) );
725725 $this->showForm( $error );
726726 return false;
727727 }

Status & tagging log