X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FSpecialEmailuser.php;h=2d9645dec0878c31a8a3a6c70bbcbfe55adf349a;hb=f9eb13cbd90de0da6d8b006492c8cc9167bf40af;hp=c1a071f9e4344a88b6b8f935b63559736030dea1;hpb=014093acc4e0c277d0d92fdc54fb620210d6ec8a;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/SpecialEmailuser.php b/includes/SpecialEmailuser.php index c1a071f9e4..2d9645dec0 100644 --- a/includes/SpecialEmailuser.php +++ b/includes/SpecialEmailuser.php @@ -11,8 +11,8 @@ function wfSpecialEmailuser() $wgOut->errorpage( "mailnologin", "mailnologintext" ); return; } - $action = $wgRequest->getVal( $action ); - $target = $wgRequest->getVal( $target ); + $action = $wgRequest->getVal( 'action' ); + $target = $wgRequest->getVal( 'target' ); if ( "" == $target ) { $wgOut->errorpage( "notargettitle", "notargettext" ); return; @@ -59,12 +59,13 @@ class EmailUserForm { function showForm( $err ) { global $wgOut, $wgUser, $wgLang; - global $wpSubject, $wpText; $wgOut->setPagetitle( wfMsg( "emailpage" ) ); $wgOut->addWikiText( wfMsg( "emailpagetext" ) ); - if ( ! $wpSubject ) { $wpSubject = wfMsg( "defemailsubject" ); } + if ( $this->subject === "" ) { + $this->subject = wfMsg( "defemailsubject" ); + } $emf = wfMsg( "emailfrom" ); $sender = $wgUser->getName(); @@ -73,7 +74,8 @@ class EmailUserForm { $emr = wfMsg( "emailsubject" ); $emm = wfMsg( "emailmessage" ); $ems = wfMsg( "emailsend" ); - + $encSubject = htmlspecialchars( $this->subject ); + $titleObj = Title::makeTitle( NS_SPECIAL, "Emailuser" ); $action = $titleObj->escapeLocalURL( "target={$this->target}&action=submit" ); @@ -92,13 +94,13 @@ class EmailUserForm { {$emr}: - + {$emm}:   @@ -111,16 +113,16 @@ class EmailUserForm { function doSubmit() { global $wgOut, $wgUser, $wgLang, $wgOutputEncoding; - global $wpSubject, $wpText, $this->target; $from = wfQuotedPrintable( $wgUser->getName() ) . " <" . $wgUser->getEmail() . ">"; - $mailResult = userMailer( $this->mAddress, $from, wfQuotedPrintable( $wpSubject ), $wpText ); + $mailResult = userMailer( $this->mAddress, $from, wfQuotedPrintable( $this->subject ), $this->text ); if (! $mailResult) { $titleObj = Title::makeTitle( NS_SPECIAL, "Emailuser" ); - $wgOut->redirect( $titleObj->getFullURL( "target={$this->target}&action=success" ) ); + $encTarget = wfUrlencode( $this->target ); + $wgOut->redirect( $titleObj->getFullURL( "target={$encTarget}&action=success" ) ); } else $wgOut->addHTML( wfMsg( "usermailererror" ) . $mailResult);