r113407 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113406‎ | r113407 | r113408 >
Date:21:39, 8 March 2012
Author:ialex
Status:ok
Tags:
Comment:
* (bug 35019) Fix for rr99942: edit summaries are no longer transformed in notification e-mails
Modified paths:
  • /branches/REL1_19/phase3/RELEASE-NOTES-1.19 (modified) (history)
  • /branches/REL1_19/phase3/includes/UserMailer.php (modified) (history)
  • /trunk/phase3/RELEASE-NOTES-1.19 (modified) (history)
  • /trunk/phase3/includes/UserMailer.php (modified) (history)

Diff [purge]

Index: trunk/phase3/RELEASE-NOTES-1.19
@@ -14,6 +14,7 @@
1515 === Changes since 1.19 beta 1 ===
1616 * (bug 35014) Including a special page no longer sets the page's title to the
1717 included page
 18+* (bug 35019) Edit summaries are no longer transformed in notification e-mails
1819
1920 === Configuration changes in 1.19 ===
2021 * Removed SkinTemplateSetupPageCss hook; use BeforePageDisplay instead.
Index: trunk/phase3/includes/UserMailer.php
@@ -619,6 +619,7 @@
620620 # simply editing the Meta pages
621621
622622 $keys = array();
 623+ $postTransformKeys = array();
623624
624625 if ( $this->oldid ) {
625626 // Always show a link to the diff which triggered the mail. See bug 32210.
@@ -642,7 +643,6 @@
643644 $keys['$PAGETITLE'] = $this->title->getPrefixedText();
644645 $keys['$PAGETITLE_URL'] = $this->title->getCanonicalUrl();
645646 $keys['$PAGEMINOREDIT'] = $this->minorEdit ? wfMsgForContent( 'minoredit' ) : '';
646 - $keys['$PAGESUMMARY'] = $this->summary == '' ? ' - ' : $this->summary;
647647 $keys['$UNWATCHURL'] = $this->title->getCanonicalUrl( 'action=unwatch' );
648648
649649 if ( $this->editor->isAnon() ) {
@@ -657,16 +657,20 @@
658658
659659 $keys['$PAGEEDITOR_WIKI'] = $this->editor->getUserPage()->getCanonicalUrl();
660660
 661+ # Replace this after transforming the message, bug 35019
 662+ $postTransformKeys['$PAGESUMMARY'] = $this->summary == '' ? ' - ' : $this->summary;
 663+
661664 # Now build message's subject and body
662665
663666 $subject = wfMsgExt( 'enotif_subject', 'content' );
664667 $subject = strtr( $subject, $keys );
665 - $this->subject = MessageCache::singleton()->transform( $subject, false, null, $this->title );
 668+ $subject = MessageCache::singleton()->transform( $subject, false, null, $this->title );
 669+ $this->subject = strtr( $subject, $postTransformKeys );
666670
667671 $body = wfMsgExt( 'enotif_body', 'content' );
668672 $body = strtr( $body, $keys );
669673 $body = MessageCache::singleton()->transform( $body, false, null, $this->title );
670 - $this->body = wordwrap( $body, 72 );
 674+ $this->body = wordwrap( strtr( $body, $postTransformKeys ), 72 );
671675
672676 # Reveal the page editor's address as REPLY-TO address only if
673677 # the user has not opted-out and the option is enabled at the
Index: branches/REL1_19/phase3/RELEASE-NOTES-1.19
@@ -14,6 +14,7 @@
1515 === Changes since 1.19 beta 1 ===
1616 * (bug 35014) Including a special page no longer sets the page's title to the
1717 included page
 18+* (bug 35019) Edit summaries are no longer transformed in notification e-mails
1819
1920 === Configuration changes in 1.19 ===
2021 * Removed SkinTemplateSetupPageCss hook; use BeforePageDisplay instead.
Index: branches/REL1_19/phase3/includes/UserMailer.php
@@ -617,6 +617,7 @@
618618 # simply editing the Meta pages
619619
620620 $keys = array();
 621+ $postTransformKeys = array();
621622
622623 if ( $this->oldid ) {
623624 if ( $wgEnotifImpersonal ) {
@@ -639,7 +640,6 @@
640641 $keys['$PAGETITLE'] = $this->title->getPrefixedText();
641642 $keys['$PAGETITLE_URL'] = $this->title->getCanonicalUrl();
642643 $keys['$PAGEMINOREDIT'] = $this->minorEdit ? wfMsgForContent( 'minoredit' ) : '';
643 - $keys['$PAGESUMMARY'] = $this->summary == '' ? ' - ' : $this->summary;
644644 $keys['$UNWATCHURL'] = $this->title->getCanonicalUrl( 'action=unwatch' );
645645
646646 if ( $this->editor->isAnon() ) {
@@ -654,16 +654,20 @@
655655
656656 $keys['$PAGEEDITOR_WIKI'] = $this->editor->getUserPage()->getCanonicalUrl();
657657
 658+ # Replace this after transforming the message, bug 35019
 659+ $postTransformKeys['$PAGESUMMARY'] = $this->summary == '' ? ' - ' : $this->summary;
 660+
658661 # Now build message's subject and body
659662
660663 $subject = wfMsgExt( 'enotif_subject', 'content' );
661664 $subject = strtr( $subject, $keys );
662 - $this->subject = MessageCache::singleton()->transform( $subject, false, null, $this->title );
 665+ $subject = MessageCache::singleton()->transform( $subject, false, null, $this->title );
 666+ $this->subject = strtr( $subject, $postTransformKeys );
663667
664668 $body = wfMsgExt( 'enotif_body', 'content' );
665669 $body = strtr( $body, $keys );
666670 $body = MessageCache::singleton()->transform( $body, false, null, $this->title );
667 - $this->body = wordwrap( $body, 72 );
 671+ $this->body = wordwrap( strtr( $body, $postTransformKeys ), 72 );
668672
669673 # Reveal the page editor's address as REPLY-TO address only if
670674 # the user has not opted-out and the option is enabled at the

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r99942* Do magic word parsing after parameter replacement in MediaWiki:Enotif_body ...ialex09:53, 16 October 2011

Status & tagging log