http://www.mediawiki.org/wiki/Special:Code/MediaWiki/95002

Revision: 95002
Author:   catrope
Date:     2011-08-19 14:46:03 +0000 (Fri, 19 Aug 2011)
Log Message:
-----------
Use canonical URLs (introduced in r94995) for all URLs in e-mails

Modified Paths:
--------------
    trunk/phase3/includes/User.php
    trunk/phase3/includes/UserMailer.php

Modified: trunk/phase3/includes/User.php
===================================================================
--- trunk/phase3/includes/User.php      2011-08-19 14:41:35 UTC (rev 95001)
+++ trunk/phase3/includes/User.php      2011-08-19 14:46:03 UTC (rev 95002)
@@ -3315,14 +3315,14 @@
         * @return String Formatted URL
         */
        protected function getTokenUrl( $page, $token ) {
-               global $wgArticlePath;
-               return wfExpandUrl(
+               global $wgCanonicalServer, $wgArticlePath;
+               
+               return $wgCanonicalServer .
                        str_replace(
                                '$1',
                                "Special:$page/$token",
-                               $wgArticlePath ),
-                       PROTO_HTTP
-               );
+                               $wgArticlePath
+                       );
        }
 
        /**

Modified: trunk/phase3/includes/UserMailer.php
===================================================================
--- trunk/phase3/includes/UserMailer.php        2011-08-19 14:41:35 UTC (rev 
95001)
+++ trunk/phase3/includes/UserMailer.php        2011-08-19 14:46:03 UTC (rev 
95002)
@@ -523,7 +523,7 @@
                $keys    = array();
 
                if ( $this->oldid ) {
-                       $difflink = wfExpandUrl( $this->title->getFullUrl( 
'diff=0&oldid=' . $this->oldid ), PROTO_HTTP );
+                       $difflink = $this->title->getCanonicalUrl( 
'diff=0&oldid=' . $this->oldid );
                        $keys['$NEWPAGE'] = wfMsgForContent( 
'enotif_lastvisited', $difflink );
                        $keys['$OLDID']   = $this->oldid;
                        $keys['$CHANGEDORCREATED'] = wfMsgForContent( 'changed' 
);
@@ -540,17 +540,17 @@
                         * revision.
                         */
                        $keys['$NEWPAGE'] = wfMsgForContent( 'enotif_lastdiff',
-                                       wfExpandUrl( $this->title->getFullURL( 
"oldid={$this->oldid}&diff=next" ), PROTO_HTTP ) );
+                                       $this->title->getCanonicalUrl( 
"oldid={$this->oldid}&diff=next" ) );
                }
 
                $body = strtr( $body, $keys );
                $pagetitle = $this->title->getPrefixedText();
                $keys['$PAGETITLE']          = $pagetitle;
-               $keys['$PAGETITLE_URL']      = wfExpandUrl( 
$this->title->getFullUrl(), PROTO_HTTP );
+               $keys['$PAGETITLE_URL']      = $this->title->getCanonicalUrl();
 
                $keys['$PAGEMINOREDIT']      = $medit;
                $keys['$PAGESUMMARY']        = $summary;
-               $keys['$UNWATCHURL']         = wfExpandUrl( 
$this->title->getFullUrl( 'action=unwatch' ), PROTO_HTTP );
+               $keys['$UNWATCHURL']         = $this->title->getCanonicalUrl( 
'action=unwatch' );
 
                $subject = strtr( $subject, $keys );
 
@@ -585,10 +585,10 @@
                        $subject = str_replace( '$PAGEEDITOR', $name, $subject 
);
                        $keys['$PAGEEDITOR']          = $name;
                        $emailPage = SpecialPage::getSafeTitleFor( 'Emailuser', 
$name );
-                       $keys['$PAGEEDITOR_EMAIL'] = wfExpandUrl( 
$emailPage->getFullUrl(), PROTO_HTTP );
+                       $keys['$PAGEEDITOR_EMAIL'] = 
$emailPage->getCanonicalUrl();
                }
                $userPage = $editor->getUserPage();
-               $keys['$PAGEEDITOR_WIKI'] = wfExpandUrl( 
$userPage->getFullUrl(), PROTO_HTTP );
+               $keys['$PAGEEDITOR_WIKI'] = $userPage->getCanonicalUrl();
                $body = strtr( $body, $keys );
                $body = wordwrap( $body, 72 );
 


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to