From: Brion Vibber " . wfMsg( "importfailed",
- htmlspecialchars( $result->toString() ) ) . "
" . wfMsg( "importsuccess" ) . "
" ); diff --git a/includes/SpecialPreferences.php b/includes/SpecialPreferences.php index 56138e98b0..4ebcb3623a 100644 --- a/includes/SpecialPreferences.php +++ b/includes/SpecialPreferences.php @@ -261,7 +261,7 @@ class PreferencesForm { # User can come back through the confirmation URL to re-enable email. $result = $wgUser->sendConfirmationMail(); if( WikiError::isError( $result ) ) { - $error = wfMsg( 'mailerror', $result->toString() ); + $error = wfMsg( 'mailerror', $result->getMessage() ); } else { $error = wfMsg( 'eauthentsent', $wgUser->getName() ); } diff --git a/includes/WikiError.php b/includes/WikiError.php index 65a64556b2..ece931f438 100644 --- a/includes/WikiError.php +++ b/includes/WikiError.php @@ -37,10 +37,19 @@ class WikiError { /** * @return string Plaintext error message to display */ - function toString() { + function getMessage() { return $this->mMessage; } + /** + * In following PEAR_Error model this could be formatted differently, + * but so far it's not. + * @return string + */ + function toString() { + return $this->getMessage(); + } + /** * Returns true if the given object is a WikiError-descended * error object, false otherwise. @@ -83,9 +92,9 @@ class WikiXmlError extends WikiError { xml_parser_free( $parser ); } - function toString() { + function getMessage() { return $this->mMessage . ': ' . xml_error_string( $this->mXmlError ); } } -?> \ No newline at end of file +?>