r36669 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r36668‎ | r36669 | r36670 >
Date:13:06, 26 June 2008
Author:daniel
Status:old
Tags:
Comment:
tweaks: fixing interaction with captcha extension, using wiki-text messages instead of HTML
Modified paths:
  • /trunk/extensions/ContactPage/SpecialContact.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ContactPage/SpecialContact.php
@@ -104,7 +104,7 @@
105105 */
106106 function EmailContactForm( $target ) {
107107 global $wgRequest, $wgUser;
108 - global $wgCaptcha, $wgCaptchaTriggers;
 108+ global $wgCaptchaClass, $wgCaptchaTriggers;
109109
110110 $this->target = $target;
111111 $this->text = $wgRequest->getText( 'wpText' );
@@ -120,9 +120,10 @@
121121 }
122122
123123 //prepare captcha if applicable
124 - if ( $wgCaptcha && @$wgCaptchaTriggers['contactpage'] ) {
125 - $wgCaptcha->trigger = 'contactpage';
126 - $wgCaptcha->action = 'contact';
 124+ if ( $wgCaptchaClass && @$wgCaptchaTriggers['contactpage'] ) {
 125+ $captcha = ConfirmEditHooks::getInstance();
 126+ $captcha->trigger = 'contactpage';
 127+ $captcha->action = 'contact';
127128 }
128129 }
129130
@@ -248,7 +249,7 @@
249250 $mailResult = userMailer( $to, $from, $subject, $this->text, $replyaddr );
250251
251252 if( WikiError::isError( $mailResult ) ) {
252 - $wgOut->addHTML( wfMsg( "usermailererror" ) . $mailResult);
 253+ $wgOut->addWikiText( wfMsg( "usermailererror" ) . $mailResult->getMessage());
253254 } else {
254255
255256 // if the user requested a copy of this mail, do this now,
@@ -264,7 +265,7 @@
265266 // We can either show them an error, or we can say everything was fine,
266267 // or we can say we sort of failed AND sort of succeeded. Of these options,
267268 // simply saying there was an error is probably best.
268 - $wgOut->addHTML( wfMsg( "usermailererror" ) . $ccResult);
 269+ $wgOut->addWikiText( wfMsg( "usermailererror" ) . $ccResult);
269270 return;
270271 }
271272 }
@@ -285,7 +286,7 @@
286287 global $wgOut;
287288
288289 $wgOut->setPagetitle( wfMsg( "emailsent" ) );
289 - $wgOut->addHTML( wfMsg( "emailsenttext" ) );
 290+ $wgOut->addWikiText( wfMsg( "emailsenttext" ) );
290291
291292 $wgOut->returnToMain( false );
292293 }

Status & tagging log