Index: trunk/extensions/ContactPage/SpecialContact.php |
— | — | @@ -104,7 +104,7 @@ |
105 | 105 | */ |
106 | 106 | function EmailContactForm( $target ) { |
107 | 107 | global $wgRequest, $wgUser; |
108 | | - global $wgCaptcha, $wgCaptchaTriggers; |
| 108 | + global $wgCaptchaClass, $wgCaptchaTriggers; |
109 | 109 | |
110 | 110 | $this->target = $target; |
111 | 111 | $this->text = $wgRequest->getText( 'wpText' ); |
— | — | @@ -120,9 +120,10 @@ |
121 | 121 | } |
122 | 122 | |
123 | 123 | //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'; |
127 | 128 | } |
128 | 129 | } |
129 | 130 | |
— | — | @@ -248,7 +249,7 @@ |
249 | 250 | $mailResult = userMailer( $to, $from, $subject, $this->text, $replyaddr ); |
250 | 251 | |
251 | 252 | if( WikiError::isError( $mailResult ) ) { |
252 | | - $wgOut->addHTML( wfMsg( "usermailererror" ) . $mailResult); |
| 253 | + $wgOut->addWikiText( wfMsg( "usermailererror" ) . $mailResult->getMessage()); |
253 | 254 | } else { |
254 | 255 | |
255 | 256 | // if the user requested a copy of this mail, do this now, |
— | — | @@ -264,7 +265,7 @@ |
265 | 266 | // We can either show them an error, or we can say everything was fine, |
266 | 267 | // or we can say we sort of failed AND sort of succeeded. Of these options, |
267 | 268 | // simply saying there was an error is probably best. |
268 | | - $wgOut->addHTML( wfMsg( "usermailererror" ) . $ccResult); |
| 269 | + $wgOut->addWikiText( wfMsg( "usermailererror" ) . $ccResult); |
269 | 270 | return; |
270 | 271 | } |
271 | 272 | } |
— | — | @@ -285,7 +286,7 @@ |
286 | 287 | global $wgOut; |
287 | 288 | |
288 | 289 | $wgOut->setPagetitle( wfMsg( "emailsent" ) ); |
289 | | - $wgOut->addHTML( wfMsg( "emailsenttext" ) ); |
| 290 | + $wgOut->addWikiText( wfMsg( "emailsenttext" ) ); |
290 | 291 | |
291 | 292 | $wgOut->returnToMain( false ); |
292 | 293 | } |