From b88212a0bf2610b1fdce825e7aac2e6aa0f956b1 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Thu, 4 Aug 2011 15:13:17 +0000 Subject: [PATCH] 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 --- includes/UserMailer.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/includes/UserMailer.php b/includes/UserMailer.php index 164b8ba4bd..eee61fc82d 100644 --- a/includes/UserMailer.php +++ b/includes/UserMailer.php @@ -523,7 +523,7 @@ class EmailNotification { $keys = array(); if ( $this->oldid ) { - $difflink = $this->title->getFullUrl( 'diff=0&oldid=' . $this->oldid ); + $difflink = wfExpandUrl( $this->title->getFullUrl( 'diff=0&oldid=' . $this->oldid ), PROTO_HTTP ); $keys['$NEWPAGE'] = wfMsgForContent( 'enotif_lastvisited', $difflink ); $keys['$OLDID'] = $this->oldid; $keys['$CHANGEDORCREATED'] = wfMsgForContent( 'changed' ); @@ -540,17 +540,17 @@ class EmailNotification { * revision. */ $keys['$NEWPAGE'] = wfMsgForContent( 'enotif_lastdiff', - $this->title->getFullURL( "oldid={$this->oldid}&diff=next" ) ); + wfExpandUrl( $this->title->getFullURL( "oldid={$this->oldid}&diff=next" ), PROTO_HTTP ) ); } $body = strtr( $body, $keys ); $pagetitle = $this->title->getPrefixedText(); $keys['$PAGETITLE'] = $pagetitle; - $keys['$PAGETITLE_URL'] = $this->title->getFullUrl(); + $keys['$PAGETITLE_URL'] = wfExpandUrl( $this->title->getFullUrl(), PROTO_HTTP ); $keys['$PAGEMINOREDIT'] = $medit; $keys['$PAGESUMMARY'] = $summary; - $keys['$UNWATCHURL'] = $this->title->getFullUrl( 'action=unwatch' ); + $keys['$UNWATCHURL'] = wfExpandUrl( $this->title->getFullUrl( 'action=unwatch' ), PROTO_HTTP ); $subject = strtr( $subject, $keys ); @@ -585,10 +585,10 @@ class EmailNotification { $subject = str_replace( '$PAGEEDITOR', $name, $subject ); $keys['$PAGEEDITOR'] = $name; $emailPage = SpecialPage::getSafeTitleFor( 'Emailuser', $name ); - $keys['$PAGEEDITOR_EMAIL'] = $emailPage->getFullUrl(); + $keys['$PAGEEDITOR_EMAIL'] = wfExpandUrl( $emailPage->getFullUrl(), PROTO_HTTP ); } $userPage = $editor->getUserPage(); - $keys['$PAGEEDITOR_WIKI'] = $userPage->getFullUrl(); + $keys['$PAGEEDITOR_WIKI'] = wfExpandUrl( $userPage->getFullUrl(), PROTO_HTTP ); $body = strtr( $body, $keys ); $body = wordwrap( $body, 72 ); -- 2.20.1