r93891 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93890‎ | r93891 | r93892 >
Date:15:13, 4 August 2011
Author:catrope
Status:ok
Tags:
Comment:
Expand all URLs in e-mail notifications to be full HTTP URLs. This prevents protocol-relative URLs from appearing in e-mail notifications if $wgServer is protocol-relative
Modified paths:
  • /trunk/phase3/includes/UserMailer.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/UserMailer.php
@@ -523,7 +523,7 @@
524524 $keys = array();
525525
526526 if ( $this->oldid ) {
527 - $difflink = $this->title->getFullUrl( 'diff=0&oldid=' . $this->oldid );
 527+ $difflink = wfExpandUrl( $this->title->getFullUrl( 'diff=0&oldid=' . $this->oldid ), PROTO_HTTP );
528528 $keys['$NEWPAGE'] = wfMsgForContent( 'enotif_lastvisited', $difflink );
529529 $keys['$OLDID'] = $this->oldid;
530530 $keys['$CHANGEDORCREATED'] = wfMsgForContent( 'changed' );
@@ -540,17 +540,17 @@
541541 * revision.
542542 */
543543 $keys['$NEWPAGE'] = wfMsgForContent( 'enotif_lastdiff',
544 - $this->title->getFullURL( "oldid={$this->oldid}&diff=next" ) );
 544+ wfExpandUrl( $this->title->getFullURL( "oldid={$this->oldid}&diff=next" ), PROTO_HTTP ) );
545545 }
546546
547547 $body = strtr( $body, $keys );
548548 $pagetitle = $this->title->getPrefixedText();
549549 $keys['$PAGETITLE'] = $pagetitle;
550 - $keys['$PAGETITLE_URL'] = $this->title->getFullUrl();
 550+ $keys['$PAGETITLE_URL'] = wfExpandUrl( $this->title->getFullUrl(), PROTO_HTTP );
551551
552552 $keys['$PAGEMINOREDIT'] = $medit;
553553 $keys['$PAGESUMMARY'] = $summary;
554 - $keys['$UNWATCHURL'] = $this->title->getFullUrl( 'action=unwatch' );
 554+ $keys['$UNWATCHURL'] = wfExpandUrl( $this->title->getFullUrl( 'action=unwatch' ), PROTO_HTTP );
555555
556556 $subject = strtr( $subject, $keys );
557557
@@ -585,10 +585,10 @@
586586 $subject = str_replace( '$PAGEEDITOR', $name, $subject );
587587 $keys['$PAGEEDITOR'] = $name;
588588 $emailPage = SpecialPage::getSafeTitleFor( 'Emailuser', $name );
589 - $keys['$PAGEEDITOR_EMAIL'] = $emailPage->getFullUrl();
 589+ $keys['$PAGEEDITOR_EMAIL'] = wfExpandUrl( $emailPage->getFullUrl(), PROTO_HTTP );
590590 }
591591 $userPage = $editor->getUserPage();
592 - $keys['$PAGEEDITOR_WIKI'] = $userPage->getFullUrl();
 592+ $keys['$PAGEEDITOR_WIKI'] = wfExpandUrl( $userPage->getFullUrl(), PROTO_HTTP );
593593 $body = strtr( $body, $keys );
594594 $body = wordwrap( $body, 72 );
595595

Follow-up revisions

RevisionCommit summaryAuthorDate
r94446MFT to REL1_18:...hashar09:27, 14 August 2011
r945571.17wmf1: MFT r87099, r90729, r93141, r93517, r93891, r94155, r94277, r94372catrope20:12, 15 August 2011

Status & tagging log