Index: trunk/phase3/includes/UserMailer.php |
— | — | @@ -257,7 +257,7 @@ |
258 | 258 | * @private |
259 | 259 | */ |
260 | 260 | var $to, $subject, $body, $replyto, $from; |
261 | | - var $user, $title, $timestamp, $summary, $minorEdit, $oldid; |
| 261 | + var $user, $title, $timestamp, $summary, $minorEdit, $oldid, $composed_common, $editor; |
262 | 262 | var $mailTargets = array(); |
263 | 263 | |
264 | 264 | /**@}}*/ |
— | — | @@ -331,7 +331,8 @@ |
332 | 332 | $this->summary = $summary; |
333 | 333 | $this->minorEdit = $minorEdit; |
334 | 334 | $this->oldid = $oldid; |
335 | | - $this->composeCommonMailtext($editor); |
| 335 | + $this->editor = $editor; |
| 336 | + $this->composed_common = false; |
336 | 337 | |
337 | 338 | $userTalkId = false; |
338 | 339 | |
— | — | @@ -410,11 +411,13 @@ |
411 | 412 | /** |
412 | 413 | * @private |
413 | 414 | */ |
414 | | - function composeCommonMailtext($editor) { |
| 415 | + function composeCommonMailtext() { |
415 | 416 | global $wgEmergencyContact, $wgNoReplyAddress; |
416 | 417 | global $wgEnotifFromEditor, $wgEnotifRevealEditorAddress; |
417 | 418 | global $wgEnotifImpersonal; |
418 | 419 | |
| 420 | + $this->composed_common = true; |
| 421 | + |
419 | 422 | $summary = ($this->summary == '') ? ' - ' : $this->summary; |
420 | 423 | $medit = ($this->minorEdit) ? wfMsg( 'minoredit' ) : ''; |
421 | 424 | |
— | — | @@ -464,6 +467,7 @@ |
465 | 468 | # Reveal the page editor's address as REPLY-TO address only if |
466 | 469 | # the user has not opted-out and the option is enabled at the |
467 | 470 | # global configuration level. |
| 471 | + $editor = $this->editor; |
468 | 472 | $name = $editor->getName(); |
469 | 473 | $adminAddress = new MailAddress( $wgEmergencyContact, 'WikiAdmin' ); |
470 | 474 | $editorAddress = new MailAddress( $editor ); |
— | — | @@ -513,6 +517,10 @@ |
514 | 518 | */ |
515 | 519 | function compose( $user ) { |
516 | 520 | global $wgEnotifImpersonal; |
| 521 | + |
| 522 | + if ( !$this->composed_common ) |
| 523 | + $this->composeCommonMailtext(); |
| 524 | + |
517 | 525 | if ( $wgEnotifImpersonal ) { |
518 | 526 | $this->mailTargets[] = new MailAddress( $user ); |
519 | 527 | } else { |