r63310 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63309‎ | r63310 | r63311 >
Date:14:00, 6 March 2010
Author:catrope
Status:ok
Tags:
Comment:
ContactPage: (bug 22741) Add IP address of sender to subject line
Modified paths:
  • /trunk/extensions/ContactPage/ContactPage.i18n.php (modified) (history)
  • /trunk/extensions/ContactPage/SpecialContact.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ContactPage/SpecialContact.php
@@ -296,6 +296,7 @@
297297
298298 $csender = $wgContactSender ? $wgContactSender : $wgEmergencyContact;
299299 $cname = $wgContactSenderName;
 300+ $senderIP = wfGetIP();
300301
301302 wfDebug( __METHOD__ . ": start\n" );
302303
@@ -319,9 +320,11 @@
320321 }
321322
322323 if ( $this->fromname !== '' ) {
323 - $subject = wfMsgForContent( 'contactpage-subject-and-sender', $subject, $this->fromname );
 324+ $subject = wfMsgForContent( 'contactpage-subject-and-sender-withip', $subject, $this->fromname, $senderIP );
324325 } elseif ( $this->fromaddress !== '' ) {
325 - $subject = wfMsgForContent( 'contactpage-subject-and-sender', $subject, $this->fromaddress );
 326+ $subject = wfMsgForContent( 'contactpage-subject-and-sender-withip', $subject, $this->fromaddress, $senderIP );
 327+ } else {
 328+ $subject = wfMsgForContent( 'contactpage-subject-and-sender', $subject, $senderIP );
326329 }
327330
328331 if( !wfRunHooks( 'ContactForm', array( &$targetAddress, &$replyto, &$subject, &$this->text ) ) ) {
Index: trunk/extensions/ContactPage/ContactPage.i18n.php
@@ -23,6 +23,7 @@
2424 'contactpage-legend' => 'Send e-mail',
2525 'contactpage-defsubject' => 'Contact message',
2626 'contactpage-subject-and-sender' => '$1 (from $2)',
 27+ 'contactpage-subject-and-sender-withip' => '$1 (from $2 at $3)',
2728 'contactpage-fromname' => 'Your name: *',
2829 'contactpage-fromaddress' => 'Your e-mail: **',
2930 'contactpage-formfootnotes' => '* optional<br />
@@ -48,7 +49,9 @@
4950 'contactpage-desc' => 'Extension description displayed on [[Special:Version]].',
5051 'contactpage-title' => '{{Identical|Contact}}',
5152 'contactpage-legend' => '{{Identical|E-mail}}',
52 - 'contactpage-defsubject' => '{{Identical|Contact}}',
 53+ 'contactpage-defsubject' => 'Default subject for sent e-mail. {{Identical|Contact}}',
 54+ 'contactpage-subject-and-sender' => 'Subject with sender included. $1 is the original subject, $2 is a user name, e-mail address or IP address.',
 55+ 'contactpage-subject-and-sender-withip' => 'Subject with sender and IP included. $1 is the original subject, $2 is a user name or e-mail address, $3 is an IP address.',
5356 'contactpage-fromaddress' => '{{Identical|E-mail}}',
5457 'contactpage-fromaddress-required' => '{{Identical|E-mail}}',
5558 );
@@ -1311,6 +1314,7 @@
13121315 'contactpage-legend' => 'E-mail versturen',
13131316 'contactpage-defsubject' => 'Contactbericht',
13141317 'contactpage-subject-and-sender' => '$1 (van $2)',
 1318+ 'contactpage-subject-and-sender-withip' => '$1 (van $2 op $3)',
13151319 'contactpage-fromname' => 'Uw naam:*',
13161320 'contactpage-fromaddress' => 'Uw e-mailadres:**',
13171321 'contactpage-formfootnotes' => '* optioneel<br />

Follow-up revisions

RevisionCommit summaryAuthorDate
r63554ContactPage: Followup to r63310: make the IP-in-the-subject line feature opti...catrope17:01, 10 March 2010
r63575wmf-deployment: Merge r63310, r63554 (IP address in e-mail feature for Contac...catrope21:06, 10 March 2010
r67332ContactPage: Tweak $wgContactIncludeIP behavior per bug 22741 comment #11: ch...catrope09:52, 4 June 2010

Status & tagging log