}
if( WikiError::isError( $result ) ) {
- $wgOut->addWikiText( htmlspecialchars( $result->toString() ) );
+ $wgOut->addWikiText( wfEscapeWikiText( $result->getMessage() ) );
} else {
$importer->setRevisionHandler( "wfImportOldRevision" );
$result = $importer->doImport();
if( WikiError::isError( $result ) ) {
$wgOut->addHTML( "<p>" . wfMsg( "importfailed",
- htmlspecialchars( $result->toString() ) ) . "</p>" );
+ htmlspecialchars( $result->getMessage() ) ) . "</p>" );
} else {
# Success!
$wgOut->addHTML( "<p>" . wfMsg( "importsuccess" ) . "</p>" );
# 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() );
}
/**
* @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.
xml_parser_free( $parser );
}
- function toString() {
+ function getMessage() {
return $this->mMessage . ': ' . xml_error_string( $this->mXmlError );
}
}
-?>
\ No newline at end of file
+?>