r95505 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95504‎ | r95505 | r95506 >
Date:19:32, 25 August 2011
Author:catrope
Status:resolved (Comments)
Tags:
Comment:
1.17wmf1: Merge a truckload of HTTPS / prot rel URL fixes: r93847, r94990, r94995, r94996, r95000, r95001, r95002, r95006, r95007, r95010, r95011, r95014, r95016, r95017
Modified paths:
  • /branches/wmf/1.17wmf1/includes/DefaultSettings.php (modified) (history)
  • /branches/wmf/1.17wmf1/includes/Defines.php (modified) (history)
  • /branches/wmf/1.17wmf1/includes/Export.php (modified) (history)
  • /branches/wmf/1.17wmf1/includes/ExternalEdit.php (modified) (history)
  • /branches/wmf/1.17wmf1/includes/Feed.php (modified) (history)
  • /branches/wmf/1.17wmf1/includes/FileDeleteForm.php (modified) (history)
  • /branches/wmf/1.17wmf1/includes/FileRevertForm.php (modified) (history)
  • /branches/wmf/1.17wmf1/includes/GlobalFunctions.php (modified) (history)
  • /branches/wmf/1.17wmf1/includes/HttpFunctions.php (modified) (history)
  • /branches/wmf/1.17wmf1/includes/OutputPage.php (modified) (history)
  • /branches/wmf/1.17wmf1/includes/ProxyTools.php (modified) (history)
  • /branches/wmf/1.17wmf1/includes/RecentChange.php (modified) (history)
  • /branches/wmf/1.17wmf1/includes/Setup.php (modified) (history)
  • /branches/wmf/1.17wmf1/includes/Skin.php (modified) (history)
  • /branches/wmf/1.17wmf1/includes/Title.php (modified) (history)
  • /branches/wmf/1.17wmf1/includes/User.php (modified) (history)
  • /branches/wmf/1.17wmf1/includes/UserMailer.php (modified) (history)
  • /branches/wmf/1.17wmf1/includes/WebRequest.php (modified) (history)
  • /branches/wmf/1.17wmf1/includes/Wiki.php (modified) (history)
  • /branches/wmf/1.17wmf1/includes/api/ApiParse.php (modified) (history)
  • /branches/wmf/1.17wmf1/includes/api/ApiQueryIWLinks.php (modified) (history)
  • /branches/wmf/1.17wmf1/includes/api/ApiQueryImageInfo.php (modified) (history)
  • /branches/wmf/1.17wmf1/includes/api/ApiQueryInfo.php (modified) (history)
  • /branches/wmf/1.17wmf1/includes/api/ApiQueryLangLinks.php (modified) (history)
  • /branches/wmf/1.17wmf1/includes/api/ApiQuerySiteinfo.php (modified) (history)
  • /branches/wmf/1.17wmf1/includes/api/ApiRsd.php (modified) (history)
  • /branches/wmf/1.17wmf1/includes/diff/DifferenceEngine.php (modified) (history)
  • /branches/wmf/1.17wmf1/includes/filerepo/File.php (modified) (history)
  • /branches/wmf/1.17wmf1/includes/parser/CoreParserFunctions.php (modified) (history)
  • /branches/wmf/1.17wmf1/includes/search/SearchEngine.php (modified) (history)
  • /branches/wmf/1.17wmf1/includes/specials/SpecialSearch.php (modified) (history)
  • /branches/wmf/1.17wmf1/languages/messages/MessagesEn.php (modified) (history)
  • /branches/wmf/1.17wmf1/maintenance/generateSitemap.php (modified) (history)
  • /branches/wmf/1.17wmf1/maintenance/purgeList.php (modified) (history)
  • /branches/wmf/1.17wmf1/opensearch_desc.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.17wmf1/maintenance/generateSitemap.php
@@ -288,7 +288,7 @@
289289 }
290290 $title = Title::makeTitle( $row->page_namespace, $row->page_title );
291291 $date = wfTimestamp( TS_ISO_8601, $row->page_touched );
292 - $entry = $this->fileEntry( $title->getFullURL(), $date, $this->priority( $namespace ) );
 292+ $entry = $this->fileEntry( $title->getCanonicalURL(), $date, $this->priority( $namespace ) );
293293 $length += strlen( $entry );
294294 $this->write( $this->file, $entry );
295295 // generate pages for language variants
@@ -296,7 +296,7 @@
297297 $variants = $wgContLang->getVariants();
298298 foreach ( $variants as $vCode ) {
299299 if ( $vCode == $wgContLang->getCode() ) continue; // we don't want default variant
300 - $entry = $this->fileEntry( $title->getFullURL( '', $vCode ), $date, $this->priority( $namespace ) );
 300+ $entry = $this->fileEntry( $title->getCanonicalURL( '', $vCode ), $date, $this->priority( $namespace ) );
301301 $length += strlen( $entry );
302302 $this->write( $this->file, $entry );
303303 }
@@ -445,7 +445,7 @@
446446
447447 $this->limit = array(
448448 strlen( $this->openFile() ),
449 - strlen( $this->fileEntry( $title->getFullUrl(), wfTimestamp( TS_ISO_8601, wfTimestamp() ), $this->priority( $namespace ) ) ),
 449+ strlen( $this->fileEntry( $title->getCanonicalURL(), wfTimestamp( TS_ISO_8601, wfTimestamp() ), $this->priority( $namespace ) ) ),
450450 strlen( $this->closeFile() )
451451 );
452452 }
Index: branches/wmf/1.17wmf1/maintenance/purgeList.php
@@ -40,7 +40,7 @@
4141 } elseif ( $page !== '' ) {
4242 $title = Title::newFromText( $page );
4343 if ( $title ) {
44 - $url = $title->getFullUrl();
 44+ $url = $title->getInternalUrl();
4545 $this->output( "$url\n" );
4646 $urls[] = $url;
4747 if ( $this->getOption( 'purge' ) ) {
Index: branches/wmf/1.17wmf1/includes/FileRevertForm.php
@@ -72,7 +72,7 @@
7373 $wgOut->addHTML( wfMsgExt( 'filerevert-success', 'parse', $this->title->getText(),
7474 $wgLang->date( $this->getTimestamp(), true ),
7575 $wgLang->time( $this->getTimestamp(), true ),
76 - wfExpandUrl( $this->file->getArchiveUrl( $this->archiveName ) ) ) );
 76+ wfExpandUrl( $this->file->getArchiveUrl( $this->archiveName ), PROTO_CURRENT ) ) );
7777 $wgOut->returnToMain( false, $this->title );
7878 } else {
7979 $wgOut->addWikiText( $status->getWikiText() );
@@ -96,7 +96,7 @@
9797 $form .= '<fieldset><legend>' . wfMsgHtml( 'filerevert-legend' ) . '</legend>';
9898 $form .= wfMsgExt( 'filerevert-intro', 'parse', $this->title->getText(),
9999 $wgLang->date( $timestamp, true ), $wgLang->time( $timestamp, true ),
100 - wfExpandUrl( $this->file->getArchiveUrl( $this->archiveName ) ) );
 100+ wfExpandUrl( $this->file->getArchiveUrl( $this->archiveName ), PROTO_CURRENT ) );
101101 $form .= '<p>' . Xml::inputLabel( wfMsg( 'filerevert-comment' ), 'wpComment', 'wpComment',
102102 60, wfMsgForContent( 'filerevert-defaultcomment',
103103 $wgContLang->date( $timestamp, false, false ), $wgContLang->time( $timestamp, false, false ) ) ) . '</p>';
Index: branches/wmf/1.17wmf1/includes/ProxyTools.php
@@ -168,7 +168,7 @@
169169 if ( !$skip ) {
170170 $title = SpecialPage::getTitleFor( 'Blockme' );
171171 $iphash = md5( $ip . $wgProxyKey );
172 - $url = $title->getFullURL( 'ip='.$iphash );
 172+ $url = wfExpandUrl( $title->getFullURL( 'ip='.$iphash ), PROTO_HTTP );
173173
174174 foreach ( $wgProxyPorts as $port ) {
175175 $params = implode( ' ', array(
Index: branches/wmf/1.17wmf1/includes/Defines.php
@@ -255,3 +255,12 @@
256256 define( 'APCOND_AGE_FROM_EDIT', 7 );
257257 define( 'APCOND_BLOCKED', 8 );
258258 /**@}*/
 259+
 260+/**
 261+ * Protocol constants for wfExpandUrl()
 262+ */
 263+define( 'PROTO_HTTP', 'http://' );
 264+define( 'PROTO_HTTPS', 'https://' );
 265+define( 'PROTO_RELATIVE', '//' );
 266+define( 'PROTO_CURRENT', null );
 267+define( 'PROTO_CANONICAL', 1 );
Property changes on: branches/wmf/1.17wmf1/includes/Defines.php
___________________________________________________________________
Added: svn:mergeinfo
259268 Merged /branches/new-installer/phase3/includes/Defines.php:r43664-66004
260269 Merged /branches/wmf-deployment/includes/Defines.php:r53381,60970
261270 Merged /branches/REL1_15/phase3/includes/Defines.php:r51646
262271 Merged /branches/wmf/1.16wmf4/includes/Defines.php:r67177,69199,76243,77266
263272 Merged /branches/sqlite/includes/Defines.php:r58211-58321
264273 Merged /trunk/phase3/includes/Defines.php:r83590,89512-89513,93847,94990,94996,95000-95002,95006-95007,95010-95011,95016-95017
Index: branches/wmf/1.17wmf1/includes/User.php
@@ -3047,14 +3047,14 @@
30483048 * @return \string Formatted URL
30493049 */
30503050 protected function getTokenUrl( $page, $token ) {
3051 - global $wgArticlePath;
3052 - return wfExpandUrl(
 3051+ global $wgCanonicalServer, $wgArticlePath;
 3052+
 3053+ return $wgCanonicalServer .
30533054 str_replace(
30543055 '$1',
30553056 "Special:$page/$token",
3056 - $wgArticlePath ),
3057 - PROTO_HTTP
3058 - );
 3057+ $wgArticlePath
 3058+ );
30593059 }
30603060
30613061 /**
Property changes on: branches/wmf/1.17wmf1/includes/User.php
___________________________________________________________________
Modified: svn:mergeinfo
30623062 Merged /trunk/phase3/includes/User.php:r93847,94990,94996,95000-95002,95007,95010-95011,95016-95017
Index: branches/wmf/1.17wmf1/includes/search/SearchEngine.php
@@ -434,13 +434,13 @@
435435 * @return String
436436 */
437437 public static function getOpenSearchTemplate() {
438 - global $wgOpenSearchTemplate, $wgServer, $wgScriptPath;
 438+ global $wgOpenSearchTemplate, $wgCanonicalServer, $wgScriptPath;
439439 if ( $wgOpenSearchTemplate ) {
440440 return $wgOpenSearchTemplate;
441441 } else {
442442 $ns = implode( '|', SearchEngine::defaultNamespaces() );
443443 if ( !$ns ) $ns = "0";
444 - return $wgServer . $wgScriptPath . '/api.php?action=opensearch&search={searchTerms}&namespace=' . $ns;
 444+ return $wgCanonicalServer . $wgScriptPath . '/api.php?action=opensearch&search={searchTerms}&namespace=' . $ns;
445445 }
446446 }
447447
Index: branches/wmf/1.17wmf1/includes/diff/DifferenceEngine.php
@@ -122,14 +122,14 @@
123123 # we'll use the application/x-external-editor interface to call
124124 # an external diff tool like kompare, kdiff3, etc.
125125 if ( $wgUseExternalEditor && $wgUser->getOption( 'externaldiff' ) ) {
126 - global $wgInputEncoding, $wgServer, $wgScript, $wgLang;
 126+ global $wgInputEncoding, $wgCanonicalServer, $wgScript, $wgLang;
127127 $wgOut->disable();
128128 header ( "Content-type: application/x-external-editor; charset=" . $wgInputEncoding );
129 - $url1 = $this->mTitle->getFullURL( array(
 129+ $url1 = $this->mTitle->getCanonicalURL( array(
130130 'action' => 'raw',
131131 'oldid' => $this->mOldid
132132 ) );
133 - $url2 = $this->mTitle->getFullURL( array(
 133+ $url2 = $this->mTitle->getCanonicalURL( array(
134134 'action' => 'raw',
135135 'oldid' => $this->mNewid
136136 ) );
@@ -138,7 +138,7 @@
139139 [Process]
140140 Type=Diff text
141141 Engine=MediaWiki
142 - Script={$wgServer}{$wgScript}
 142+ Script={$wgCanonicalServer}{$wgScript}
143143 Special namespace={$special}
144144
145145 [File]
Property changes on: branches/wmf/1.17wmf1/includes/diff/DifferenceEngine.php
___________________________________________________________________
Modified: svn:mergeinfo
146146 Merged /trunk/phase3/includes/diff/DifferenceEngine.php:r94990,94996,95016-95017
Index: branches/wmf/1.17wmf1/includes/RecentChange.php
@@ -614,7 +614,8 @@
615615 }
616616
617617 public function getIRCLine() {
618 - global $wgUseRCPatrol, $wgUseNPPatrol, $wgRC2UDPInterwikiPrefix, $wgLocalInterwiki;
 618+ global $wgUseRCPatrol, $wgUseNPPatrol, $wgRC2UDPInterwikiPrefix, $wgLocalInterwiki,
 619+ $wgCanonicalServer, $wgScript;
619620
620621 // FIXME: Would be good to replace these 2 extract() calls with something more explicit
621622 // e.g. list ($rc_type, $rc_id) = array_values ($this->mAttribs); [or something like that]
@@ -632,21 +633,18 @@
633634 if( $rc_type == RC_LOG ) {
634635 $url = '';
635636 } else {
 637+ $url = $wgCanonicalServer . $wgScript;
636638 if( $rc_type == RC_NEW ) {
637 - $url = "oldid=$rc_this_oldid";
 639+ $query = "?oldid=$rc_this_oldid";
638640 } else {
639 - $url = "diff=$rc_this_oldid&oldid=$rc_last_oldid";
 641+ $query = "?diff=$rc_this_oldid&oldid=$rc_last_oldid";
640642 }
641643 if( $wgUseRCPatrol || ($rc_type == RC_NEW && $wgUseNPPatrol) ) {
642 - $url .= "&rcid=$rc_id";
 644+ $query .= "&rcid=$rc_id";
643645 }
644 - // XXX: *HACK* this should use getFullURL(), hacked for SSL madness --brion 2005-12-26
645 - // XXX: *HACK^2* the preg_replace() undoes much of what getInternalURL() does, but we
646 - // XXX: need to call it so that URL paths on the Wikimedia secure server can be fixed
647 - // XXX: by a custom GetInternalURL hook --vyznev 2008-12-10
648 - // XXX: Also, getInternalUrl() may return a protocol-relative URL.
649 - // XXX: In that case, expand it to an HTTP URL, even if this is an HTTPS request --catrope 2011-08-17
650 - $url = preg_replace( '/title=[^&]*&/', '', wfExpandUrl( $titleObj->getInternalURL( $url ), PROTO_HTTP ) );
 646+ // HACK: We need this hook for WMF's secure server setup
 647+ wfRunHooks( 'IRCLineURL', array( &$url, &$query ) );
 648+ $url .= $query;
651649 }
652650
653651 if( isset( $oldSize ) && isset( $newSize ) ) {
Property changes on: branches/wmf/1.17wmf1/includes/RecentChange.php
___________________________________________________________________
Modified: svn:mergeinfo
654652 Merged /trunk/phase3/includes/RecentChange.php:r93847,94990,94995-94996,95000-95002,95007,95010-95011,95016-95017
Index: branches/wmf/1.17wmf1/includes/GlobalFunctions.php
@@ -1465,6 +1465,7 @@
14661466 * PROTO_HTTPS: Output a URL starting with https://
14671467 * PROTO_RELATIVE: Output a URL starting with // (protocol-relative URL)
14681468 * PROTO_CURRENT: Output a URL starting with either http:// or https:// , depending on which protocol was used for the current incoming request
 1469+ * PROTO_CANONICAL: For URLs without a domain, like /w/index.php , use $wgCanonicalServer. For protocol-relative URLs, use the protocol of $wgCanonicalServer
14691470 *
14701471 * @todo this won't work with current-path-relative URLs
14711472 * like "subdir/foo.html", etc.
@@ -1474,21 +1475,34 @@
14751476 * @return string Fully-qualified URL
14761477 */
14771478 function wfExpandUrl( $url, $defaultProto = PROTO_CURRENT ) {
1478 - global $wgServer;
 1479+ global $wgServer, $wgCanonicalServer;
 1480+ $serverUrl = $defaultProto === PROTO_CANONICAL ? $wgCanonicalServer : $wgServer;
 1481+
14791482 if ( $defaultProto === PROTO_CURRENT ) {
14801483 $defaultProto = WebRequest::detectProtocol() . '://';
14811484 }
14821485
1483 - // Analyze $wgServer to obtain its protocol
1484 - $bits = wfParseUrl( $wgServer );
 1486+ // Analyze $serverUrl to obtain its protocol
 1487+ $bits = wfParseUrl( $serverUrl );
14851488 $serverHasProto = $bits && $bits['scheme'] != '';
 1489+
 1490+ if ( $defaultProto === PROTO_CANONICAL ) {
 1491+ if ( $serverHasProto ) {
 1492+ $defaultProto = $bits['scheme'] . '://';
 1493+ } else {
 1494+ // $wgCanonicalServer doesn't have a protocol. This really isn't supposed to happen
 1495+ // Fall back to HTTP in this ridiculous case
 1496+ $defaultProto = PROTO_HTTP;
 1497+ }
 1498+ }
 1499+
14861500 $defaultProtoWithoutSlashes = substr( $defaultProto, 0, -2 );
14871501
14881502 if( substr( $url, 0, 2 ) == '//' ) {
14891503 return $defaultProtoWithoutSlashes . $url;
14901504 } elseif( substr( $url, 0, 1 ) == '/' ) {
1491 - // If $wgServer is protocol-relative, prepend $defaultProtoWithoutSlashes, otherwise leave it alone
1492 - return ( $serverHasProto ? '' : $defaultProtoWithoutSlashes ) . $wgServer . $url;
 1505+ // If $serverUrl is protocol-relative, prepend $defaultProtoWithoutSlashes, otherwise leave it alone
 1506+ return ( $serverHasProto ? '' : $defaultProtoWithoutSlashes ) . $serverUrl . $url;
14931507 } else {
14941508 return $url;
14951509 }
Property changes on: branches/wmf/1.17wmf1/includes/GlobalFunctions.php
___________________________________________________________________
Modified: svn:mergeinfo
14961510 Merged /trunk/phase3/includes/GlobalFunctions.php:r93847,94990,94996,95000-95002,95006-95007,95010-95011,95016-95017
Index: branches/wmf/1.17wmf1/includes/parser/CoreParserFunctions.php
@@ -31,6 +31,8 @@
3232 $parser->setFunctionHook( 'localurle', array( __CLASS__, 'localurle' ), SFH_NO_HASH );
3333 $parser->setFunctionHook( 'fullurl', array( __CLASS__, 'fullurl' ), SFH_NO_HASH );
3434 $parser->setFunctionHook( 'fullurle', array( __CLASS__, 'fullurle' ), SFH_NO_HASH );
 35+ $parser->setFunctionHook( 'canonicalurl', array( __CLASS__, 'canonicalurl' ), SFH_NO_HASH );
 36+ $parser->setFunctionHook( 'canonicalurle', array( __CLASS__, 'canonicalurle' ), SFH_NO_HASH );
3537 $parser->setFunctionHook( 'formatnum', array( __CLASS__, 'formatnum' ), SFH_NO_HASH );
3638 $parser->setFunctionHook( 'grammar', array( __CLASS__, 'grammar' ), SFH_NO_HASH );
3739 $parser->setFunctionHook( 'gender', array( __CLASS__, 'gender' ), SFH_NO_HASH );
@@ -194,6 +196,8 @@
195197 static function localurle( $parser, $s = '', $arg = null ) { return self::urlFunction( 'escapeLocalURL', $s, $arg ); }
196198 static function fullurl( $parser, $s = '', $arg = null ) { return self::urlFunction( 'getFullURL', $s, $arg ); }
197199 static function fullurle( $parser, $s = '', $arg = null ) { return self::urlFunction( 'escapeFullURL', $s, $arg ); }
 200+ static function canonicalurl( $parser, $s = '', $arg = null ) { return self::urlFunction( 'getCanonicalURL', $s, $arg ); }
 201+ static function canonicalurle( $parser, $s = '', $arg = null ) { return self::urlFunction( 'escapeCanonicalURL', $s, $arg ); }
198202
199203 static function urlFunction( $func, $s = '', $arg = null ) {
200204 $title = Title::newFromText( $s );
Index: branches/wmf/1.17wmf1/includes/ExternalEdit.php
@@ -29,7 +29,7 @@
3030 }
3131
3232 function edit() {
33 - global $wgOut, $wgScript, $wgScriptPath, $wgServer, $wgLang;
 33+ global $wgOut, $wgScript, $wgScriptPath, $wgCanonicalServer, $wgLang;
3434 $wgOut->disable();
3535 $name=$this->mTitle->getText();
3636 $pos=strrpos($name,".")+1;
@@ -41,14 +41,14 @@
4242 # details.
4343 if(!isset($this->mMode)) {
4444 $type="Edit text";
45 - $url=$this->mTitle->getFullURL("action=edit&internaledit=true");
 45+ $url=$this->mTitle->getCanonicalURL("action=edit&internaledit=true");
4646 # *.wiki file extension is used by some editors for syntax
4747 # highlighting, so we follow that convention
4848 $extension="wiki";
4949 } elseif($this->mMode=="file") {
5050 $type="Edit file";
5151 $image = wfLocalFile( $this->mTitle );
52 - $url = $image->getFullURL();
 52+ $url = $image->getCanonicalURL();
5353 $extension=substr($name, $pos);
5454 }
5555 $special=$wgLang->getNsText(NS_SPECIAL);
@@ -56,8 +56,8 @@
5757 [Process]
5858 Type=$type
5959 Engine=MediaWiki
60 -Script={$wgServer}{$wgScript}
61 -Server={$wgServer}
 60+Script={$wgCanonicalServer}{$wgScript}
 61+Server={$wgCanonicalServer}
6262 Path={$wgScriptPath}
6363 Special namespace=$special
6464
Index: branches/wmf/1.17wmf1/includes/Setup.php
@@ -191,6 +191,12 @@
192192 require_once( "$IP/includes/ProxyTools.php" );
193193 require_once( "$IP/includes/ImageFunctions.php" );
194194 wfProfileOut( $fname.'-includes' );
 195+
 196+# Now that GlobalFunctions is loaded, set the default for $wgCanonicalServer
 197+if ( $wgCanonicalServer === false ) {
 198+ $wgCanonicalServer = wfExpandUrl( $wgServer, PROTO_HTTP );
 199+}
 200+
195201 wfProfileIn( $fname.'-misc1' );
196202
197203 # Raise the memory limit if it's too low
Index: branches/wmf/1.17wmf1/includes/Feed.php
@@ -222,12 +222,15 @@
223223 * but can also be called separately.
224224 */
225225 public function httpHeaders() {
226 - global $wgOut;
 226+ global $wgOut, $wgVaryOnXFPForAPI;
227227
228228 # We take over from $wgOut, excepting its cache header info
229229 $wgOut->disable();
230230 $mimetype = $this->contentType();
231231 header( "Content-type: $mimetype; charset=UTF-8" );
 232+ if ( $wgVaryOnXFPForAPI ) {
 233+ $wgOut->addVaryHeader( 'X-Forwarded-Proto' );
 234+ }
232235 $wgOut->sendCacheControl();
233236
234237 }
@@ -256,7 +259,7 @@
257260 $this->httpHeaders();
258261 echo '<?xml version="1.0"?>' . "\n";
259262 echo '<?xml-stylesheet type="text/css" href="' .
260 - htmlspecialchars( wfExpandUrl( "$wgStylePath/common/feed.css?$wgStyleVersion" ) ) .
 263+ htmlspecialchars( wfExpandUrl( "$wgStylePath/common/feed.css?$wgStyleVersion", PROTO_CURRENT ) ) .
261264 '"?' . ">\n";
262265 }
263266 }
@@ -288,7 +291,7 @@
289292 ?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
290293 <channel>
291294 <title><?php print $this->getTitle() ?></title>
292 - <link><?php print $this->getUrl() ?></link>
 295+ <link><?php print wfExpandUrl( $this->getUrl(), PROTO_CURRENT ) ?></link>
293296 <description><?php print $this->getDescription() ?></description>
294297 <language><?php print $this->getLanguage() ?></language>
295298 <generator>MediaWiki <?php print $wgVersion ?></generator>
@@ -304,12 +307,12 @@
305308 ?>
306309 <item>
307310 <title><?php print $item->getTitle() ?></title>
308 - <link><?php print $item->getUrl() ?></link>
 311+ <link><?php print wfExpandUrl( $item->getUrl(), PROTO_CURRENT ) ?></link>
309312 <guid<?php if( !$item->RSSIsPermalink ) print ' isPermaLink="false"' ?>><?php print $item->getUniqueId() ?></guid>
310313 <description><?php print $item->getDescription() ?></description>
311314 <?php if( $item->getDate() ) { ?><pubDate><?php print $this->formatTime( $item->getDate() ) ?></pubDate><?php } ?>
312315 <?php if( $item->getAuthor() ) { ?><dc:creator><?php print $item->getAuthor() ?></dc:creator><?php }?>
313 - <?php if( $item->getComments() ) { ?><comments><?php print $item->getComments() ?></comments><?php }?>
 316+ <?php if( $item->getComments() ) { ?><comments><?php print wfExpandUrl( $item->getComments(), PROTO_CURRENT ) ?></comments><?php }?>
314317 </item>
315318 <?php
316319 }
@@ -348,8 +351,8 @@
349352 ?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="<?php print $this->getLanguage() ?>">
350353 <id><?php print $this->getFeedId() ?></id>
351354 <title><?php print $this->getTitle() ?></title>
352 - <link rel="self" type="application/atom+xml" href="<?php print $this->getSelfUrl() ?>"/>
353 - <link rel="alternate" type="text/html" href="<?php print $this->getUrl() ?>"/>
 355+ <link rel="self" type="application/atom+xml" href="<?php print wfExpandUrl( $this->getSelfUrl(), PROTO_CURRENT ) ?>"/>
 356+ <link rel="alternate" type="text/html" href="<?php print wfExpandUrl( $this->getUrl(), PROTO_CURRENT ) ?>"/>
354357 <updated><?php print $this->formatTime( wfTimestampNow() ) ?>Z</updated>
355358 <subtitle><?php print $this->getDescription() ?></subtitle>
356359 <generator>MediaWiki <?php print $wgVersion ?></generator>
@@ -390,7 +393,7 @@
391394 <entry>
392395 <id><?php print $item->getUniqueId() ?></id>
393396 <title><?php print $item->getTitle() ?></title>
394 - <link rel="alternate" type="<?php print $wgMimeType ?>" href="<?php print $item->getUrl() ?>"/>
 397+ <link rel="alternate" type="<?php print $wgMimeType ?>" href="<?php print wfExpandUrl( $item->getUrl(), PROTO_CURRENT ) ?>"/>
395398 <?php if( $item->getDate() ) { ?>
396399 <updated><?php print $this->formatTime( $item->getDate() ) ?>Z</updated>
397400 <?php } ?>
Index: branches/wmf/1.17wmf1/includes/UserMailer.php
@@ -466,7 +466,7 @@
467467 $keys = array();
468468
469469 if ( $this->oldid ) {
470 - $difflink = wfExpandUrl( $this->title->getFullUrl( 'diff=0&oldid=' . $this->oldid ), PROTO_HTTP );
 470+ $difflink = $this->title->getCanonicalUrl( 'diff=0&oldid=' . $this->oldid );
471471 $keys['$NEWPAGE'] = wfMsgForContent( 'enotif_lastvisited', $difflink );
472472 $keys['$OLDID'] = $this->oldid;
473473 $keys['$CHANGEDORCREATED'] = wfMsgForContent( 'changed' );
@@ -483,17 +483,17 @@
484484 * revision.
485485 */
486486 $keys['$NEWPAGE'] = wfMsgForContent( 'enotif_lastdiff',
487 - wfExpandUrl( $this->title->getFullURL( "oldid={$this->oldid}&diff=next" ), PROTO_HTTP ) );
 487+ $this->title->getCanonicalUrl( "oldid={$this->oldid}&diff=next" ) );
488488 }
489489
490490 $body = strtr( $body, $keys );
491491 $pagetitle = $this->title->getPrefixedText();
492492 $keys['$PAGETITLE'] = $pagetitle;
493 - $keys['$PAGETITLE_URL'] = wfExpandUrl( $this->title->getFullUrl(), PROTO_HTTP );
 493+ $keys['$PAGETITLE_URL'] = $this->title->getCanonicalUrl();
494494
495495 $keys['$PAGEMINOREDIT'] = $medit;
496496 $keys['$PAGESUMMARY'] = $summary;
497 - $keys['$UNWATCHURL'] = wfExpandUrl( $this->title->getFullUrl( 'action=unwatch' ), PROTO_HTTP );
 497+ $keys['$UNWATCHURL'] = $this->title->getCanonicalUrl( 'action=unwatch' );
498498
499499 $subject = strtr( $subject, $keys );
500500
@@ -528,10 +528,10 @@
529529 $subject = str_replace( '$PAGEEDITOR', $name, $subject );
530530 $keys['$PAGEEDITOR'] = $name;
531531 $emailPage = SpecialPage::getSafeTitleFor( 'Emailuser', $name );
532 - $keys['$PAGEEDITOR_EMAIL'] = wfExpandUrl( $emailPage->getFullUrl(), PROTO_HTTP );
 532+ $keys['$PAGEEDITOR_EMAIL'] = $emailPage->getCanonicalUrl();
533533 }
534534 $userPage = $editor->getUserPage();
535 - $keys['$PAGEEDITOR_WIKI'] = wfExpandUrl( $userPage->getFullUrl(), PROTO_HTTP );
 535+ $keys['$PAGEEDITOR_WIKI'] = $userPage->getCanonicalUrl();
536536 $body = strtr( $body, $keys );
537537 $body = wordwrap( $body, 72 );
538538
Index: branches/wmf/1.17wmf1/includes/filerepo/File.php
@@ -187,8 +187,12 @@
188188 * @return String
189189 */
190190 public function getFullUrl() {
191 - return wfExpandUrl( $this->getUrl() );
 191+ return wfExpandUrl( $this->getUrl(), PROTO_RELATIVE );
192192 }
 193+
 194+ public function getCanonicalUrl() {
 195+ return wfExpandUrl( $this->getUrl(), PROTO_CANONICAL );
 196+ }
193197
194198 function getViewURL() {
195199 if( $this->mustRender()) {
Property changes on: branches/wmf/1.17wmf1/includes/filerepo/File.php
___________________________________________________________________
Modified: svn:mergeinfo
196200 Merged /trunk/phase3/includes/filerepo/File.php:r93847,94990,94996,95000-95002,95007,95010-95011,95016-95017
Index: branches/wmf/1.17wmf1/includes/Export.php
@@ -405,7 +405,7 @@
406406 }
407407
408408 function homelink() {
409 - return Xml::element( 'base', array(), Title::newMainPage()->getFullUrl() );
 409+ return Xml::element( 'base', array(), Title::newMainPage()->getCanonicalUrl() );
410410 }
411411
412412 function caseSetting() {
@@ -616,7 +616,7 @@
617617 $this->writeContributor( $file->getUser( 'id' ), $file->getUser( 'text' ) ) .
618618 " " . Xml::elementClean( 'comment', null, $file->getDescription() ) . "\n" .
619619 " " . Xml::element( 'filename', null, $file->getName() ) . "\n" .
620 - " " . Xml::element( 'src', null, $file->getFullUrl() ) . "\n" .
 620+ " " . Xml::element( 'src', null, $file->getCanonicalUrl() ) . "\n" .
621621 " " . Xml::element( 'size', null, $file->getSize() ) . "\n" .
622622 " </upload>\n";
623623 }
Index: branches/wmf/1.17wmf1/includes/OutputPage.php
@@ -1649,7 +1649,7 @@
16501650 wfProfileIn( __METHOD__ );
16511651 if ( $this->mRedirect != '' ) {
16521652 # Standards require redirect URLs to be absolute
1653 - $this->mRedirect = wfExpandUrl( $this->mRedirect );
 1653+ $this->mRedirect = wfExpandUrl( $this->mRedirect, PROTO_CURRENT );
16541654 if( $this->mRedirectCode == '301' || $this->mRedirectCode == '303' ) {
16551655 if( !$wgDebugRedirects ) {
16561656 $message = self::getStatusMessage( $this->mRedirectCode );
Property changes on: branches/wmf/1.17wmf1/includes/OutputPage.php
___________________________________________________________________
Modified: svn:mergeinfo
16571657 Merged /trunk/phase3/includes/OutputPage.php:r94990,94996,95010-95011,95016-95017
Index: branches/wmf/1.17wmf1/includes/api/ApiQuerySiteinfo.php
@@ -105,7 +105,7 @@
106106 $data = array();
107107 $mainPage = Title::newMainPage();
108108 $data['mainpage'] = $mainPage->getPrefixedText();
109 - $data['base'] = wfExpandUrl( $mainPage->getFullUrl() );
 109+ $data['base'] = wfExpandUrl( $mainPage->getFullUrl(), PROTO_CURRENT );
110110 $data['sitename'] = $GLOBALS['wgSitename'];
111111 $data['generator'] = "MediaWiki {$GLOBALS['wgVersion']}";
112112 $data['phpversion'] = phpversion();
@@ -267,8 +267,8 @@
268268 if ( isset( $langNames[$row->iw_prefix] ) ) {
269269 $val['language'] = $langNames[$row->iw_prefix];
270270 }
271 - $val['url'] = wfExpandUrl( $row->iw_url );
272 -
 271+ $val['url'] = wfExpandUrl( $row['iw_url'], PROTO_CURRENT );
 272+
273273 $data[] = $val;
274274 }
275275
@@ -427,7 +427,7 @@
428428 protected function appendRightsInfo( $property ) {
429429 global $wgRightsPage, $wgRightsUrl, $wgRightsText;
430430 $title = Title::newFromText( $wgRightsPage );
431 - $url = $title ? wfExpandUrl( $title->getFullURL() ) : $wgRightsUrl;
 431+ $url = $title ? wfExpandUrl( $title->getFullURL(), PROTO_CURRENT ) : $wgRightsUrl;
432432 $text = $wgRightsText;
433433 if ( !$text && $title ) {
434434 $text = $title->getPrefixedText();
Index: branches/wmf/1.17wmf1/includes/api/ApiParse.php
@@ -349,7 +349,7 @@
350350
351351 $entry['lang'] = $bits[0];
352352 if ( $title ) {
353 - $entry['url'] = wfExpandUrl( $title->getFullURL() );
 353+ $entry['url'] = wfExpandUrl( $title->getFullURL(), PROTO_CURRENT );
354354 }
355355 $this->getResult()->setContent( $entry, $bits[1] );
356356 $result[] = $entry;
@@ -407,7 +407,7 @@
408408
409409 $title = Title::newFromText( "{$prefix}:{$title}" );
410410 if ( $title ) {
411 - $entry['url'] = wfExpandUrl( $title->getFullURL() );
 411+ $entry['url'] = wfExpandUrl( $title->getFullURL(), PROTO_CURRENT );
412412 }
413413
414414 $this->getResult()->setContent( $entry, $title->getFullText() );
Property changes on: branches/wmf/1.17wmf1/includes/api/ApiParse.php
___________________________________________________________________
Modified: svn:mergeinfo
415415 Merged /trunk/phase3/includes/api/ApiParse.php:r94990,94996,95010-95011,95016-95017
Index: branches/wmf/1.17wmf1/includes/api/ApiQueryIWLinks.php
@@ -96,7 +96,7 @@
9797 if ( !is_null( $params['url'] ) ) {
9898 $title = Title::newFromText( "{$row->iwl_prefix}:{$row->iwl_title}" );
9999 if ( $title ) {
100 - $entry['url'] = wfExpandUrl( $title->getFullURL() );
 100+ $entry['url'] = wfExpandUrl( $title->getFullURL(), PROTO_CURRENT );
101101 }
102102 }
103103
Index: branches/wmf/1.17wmf1/includes/api/ApiQueryLangLinks.php
@@ -90,7 +90,7 @@
9191 if ( $params['url'] ) {
9292 $title = Title::newFromText( "{$row->ll_lang}:{$row->ll_title}" );
9393 if ( $title ) {
94 - $entry['url'] = wfExpandUrl( $title->getFullURL() );
 94+ $entry['url'] = wfExpandUrl( $title->getFullURL(), PROTO_CURRENT );
9595 }
9696 }
9797 ApiResult::setContent( $entry, $row->ll_title );
Index: branches/wmf/1.17wmf1/includes/api/ApiQueryImageInfo.php
@@ -286,7 +286,7 @@
287287 if ( !is_null( $scale ) && !$file->isOld() ) {
288288 $mto = $file->transform( array( 'width' => $scale['width'], 'height' => $scale['height'] ) );
289289 if ( $mto && !$mto->isError() ) {
290 - $vals['thumburl'] = wfExpandUrl( $mto->getUrl() );
 290+ $vals['thumburl'] = wfExpandUrl( $mto->getUrl(), PROTO_CURRENT );
291291
292292 // bug 23834 - If the URL's are the same, we haven't resized it, so shouldn't give the wanted
293293 // thumbnail sizes for the thumbnail actual size
@@ -308,8 +308,8 @@
309309 $vals['thumberror'] = $mto->toText();
310310 }
311311 }
312 - $vals['url'] = wfExpandUrl( $file->getFullURL() );
313 - $vals['descriptionurl'] = wfExpandUrl( $file->getDescriptionUrl() );
 312+ $vals['url'] = wfExpandUrl( $file->getFullURL(), PROTO_CURRENT );
 313+ $vals['descriptionurl'] = wfExpandUrl( $file->getDescriptionUrl(), PROTO_CURRENT );
314314 }
315315
316316 if ( $sha1 ) {
Property changes on: branches/wmf/1.17wmf1/includes/api/ApiQueryImageInfo.php
___________________________________________________________________
Modified: svn:mergeinfo
317317 Merged /trunk/phase3/includes/api/ApiQueryImageInfo.php:r94990,94996,95010-95011,95016-95017
Index: branches/wmf/1.17wmf1/includes/api/ApiRsd.php
@@ -97,7 +97,7 @@
9898 $apis = array(
9999 'MediaWiki' => array(
100100 // The API link is required for all RSD API entries.
101 - 'apiLink' => wfExpandUrl( wfScript( 'api' ) ),
 101+ 'apiLink' => wfExpandUrl( wfScript( 'api' ), PROTO_CURRENT ),
102102
103103 // Docs link is optional, but recommended.
104104 'docs' => 'http://mediawiki.org/wiki/API',
Index: branches/wmf/1.17wmf1/includes/api/ApiQueryInfo.php
@@ -353,8 +353,8 @@
354354 }
355355
356356 if ( $this->fld_url ) {
357 - $pageInfo['fullurl'] = wfExpandUrl( $title->getFullURL() );
358 - $pageInfo['editurl'] = wfExpandUrl( $title->getFullURL( 'action=edit' ) );
 357+ $pageInfo['fullurl'] = wfExpandUrl( $title->getFullURL(), PROTO_CURRENT );
 358+ $pageInfo['editurl'] = wfExpandUrl( $title->getFullURL( 'action=edit' ), PROTO_CURRENT );
359359 }
360360 if ( $this->fld_readable && $title->userCanRead() ) {
361361 $pageInfo['readable'] = '';
Index: branches/wmf/1.17wmf1/includes/WebRequest.php
@@ -551,15 +551,17 @@
552552 }
553553
554554 /**
555 - * Return the request URI with the canonical service and hostname.
 555+ * Return the request URI with the canonical service and hostname, path,
 556+ * and query string. This will be suitable for use as an absolute link
 557+ * in HTML or other output.
556558 *
557 - * NOTE: This will output a protocol-relative URL if $wgServer is protocol-relative
 559+ * If $wgServer is protocol-relative, this will return a fully
 560+ * qualified URL with the protocol that was used for this request.
558561 *
559562 * @return String
560563 */
561564 public function getFullRequestURL() {
562 - global $wgServer;
563 - return $wgServer . $this->getRequestURL();
 565+ return wfExpandUrl( $this->getRequestURL(), PROTO_CURRENT );
564566 }
565567
566568 /**
Property changes on: branches/wmf/1.17wmf1/includes/WebRequest.php
___________________________________________________________________
Modified: svn:mergeinfo
567569 Merged /trunk/phase3/includes/WebRequest.php:r94990,94996
Index: branches/wmf/1.17wmf1/includes/Wiki.php
@@ -216,7 +216,7 @@
217217 $title = SpecialPage::getTitleFor( $name, $subpage );
218218 }
219219 }
220 - $targetUrl = $title->getFullURL();
 220+ $targetUrl = wfExpandUrl( $title->getFullURL(), PROTO_CURRENT );
221221 // Redirect to canonical url, make it a 301 to allow caching
222222 if( $targetUrl == $request->getFullRequestURL() ) {
223223 $message = "Redirect loop detected!\n\n" .
Property changes on: branches/wmf/1.17wmf1/includes/Wiki.php
___________________________________________________________________
Modified: svn:mergeinfo
224224 Merged /trunk/phase3/includes/Wiki.php:r94990,94996
Index: branches/wmf/1.17wmf1/includes/Title.php
@@ -974,11 +974,22 @@
975975 public function escapeFullURL( $query = '' ) {
976976 return htmlspecialchars( $this->getFullURL( $query ) );
977977 }
 978+
 979+ /**
 980+ * HTML-escaped version of getCanonicalURL()
 981+ */
 982+ public function escapeCanonicalURL( $query = '', $variant = false ) {
 983+ return htmlspecialchars( $this->getCanonicalURL( $query, $variant ) );
 984+ }
978985
979986 /**
980987 * Get the URL form for an internal link.
981988 * - Used in various Squid-related code, in case we have a different
982989 * internal hostname for the server from the exposed one.
 990+ *
 991+ * This uses $wgInternalServer to qualify the path, or $wgServer
 992+ * if $wgInternalServer is not set. If the server variable used is
 993+ * protocol-relative, the URL will be expanded to http://
983994 *
984995 * @param $query \type{\string} an optional query string
985996 * @param $variant \type{\string} language variant of url (for sr, zh..)
@@ -987,12 +998,28 @@
988999 public function getInternalURL( $query = '', $variant = false ) {
9891000 global $wgInternalServer, $wgServer;
9901001 $server = $wgInternalServer !== false ? $wgInternalServer : $wgServer;
991 - $url = $server . $this->getLocalURL( $query, $variant );
 1002+ $url = wfExpandUrl( $server . $this->getLocalURL( $query, $variant ), PROTO_HTTP );
9921003 wfRunHooks( 'GetInternalURL', array( &$this, &$url, $query ) );
9931004 return $url;
9941005 }
9951006
9961007 /**
 1008+ * Get the URL for a canonical link, for use in things like IRC and
 1009+ * e-mail notifications. Uses $wgCanonicalServer and the
 1010+ * GetCanonicalURL hook.
 1011+ *
 1012+ * @param $query string An optional query string
 1013+ * @param $variant string Language variant of URL (for sr, zh, ...)
 1014+ * @return string The URL
 1015+ */
 1016+ public function getCanonicalURL( $query = '', $variant = false ) {
 1017+ global $wgCanonicalServer;
 1018+ $url = $wgCanonicalServer . $this->getLocalURL( $query, $variant );
 1019+ wfRunHooks( 'GetCanonicalURL', array( &$this, &$url, $query ) );
 1020+ return $url;
 1021+ }
 1022+
 1023+ /**
9971024 * Get the edit URL for this Title
9981025 *
9991026 * @return \type{\string} the URL, or a null string if this is an
Property changes on: branches/wmf/1.17wmf1/includes/Title.php
___________________________________________________________________
Modified: svn:mergeinfo
10001027 Merged /trunk/phase3/includes/Title.php:r93847,94990,94995-94996,95000-95002,95007,95010-95011,95016-95017
Index: branches/wmf/1.17wmf1/includes/FileDeleteForm.php
@@ -260,7 +260,7 @@
261261 $this->title->getText(),
262262 $wgLang->date( $this->getTimestamp(), true ),
263263 $wgLang->time( $this->getTimestamp(), true ),
264 - wfExpandUrl( $this->file->getArchiveUrl( $this->oldimage ) ) );
 264+ wfExpandUrl( $this->file->getArchiveUrl( $this->oldimage ), PROTO_CURRENT ) );
265265 } else {
266266 return wfMsgExt(
267267 $message,
Index: branches/wmf/1.17wmf1/includes/DefaultSettings.php
@@ -77,6 +77,15 @@
7878
7979 $wgServer .= ":" . $_SERVER['SERVER_PORT'];
8080 }
 81+
 82+/**
 83+ * Canonical URL of the server, to use in IRC feeds and notification e-mails.
 84+ * Must be fully qualified, even if $wgServer is protocol-relative.
 85+ *
 86+ * Defaults to $wgServer, expanded to a fully qualified http:// URL if needed.
 87+ */
 88+$wgCanonicalServer = false;
 89+
8190 /** @endcond */
8291
8392 /************************************************************************//**
@@ -1745,9 +1754,9 @@
17461755 $wgUseXVO = false;
17471756
17481757 /** Add X-Forwarded-Proto to the Vary and X-Vary-Options headers for API
1749 - * requests. Use this if you have an SSL termination setup and want to split
1750 - * the cache between HTTP and HTTPS for API requests. This does not affect
1751 - * 'regular' requests.
 1758+ * requests and RSS/Atom feeds. Use this if you have an SSL termination setup
 1759+ * and need to split the cache between HTTP and HTTPS for API and feed requests
 1760+ * in order to prevent cache pollution. This does not affect 'normal' requests.
17521761 */
17531762 $wgVaryOnXFPForAPI = false;
17541763
Property changes on: branches/wmf/1.17wmf1/includes/DefaultSettings.php
___________________________________________________________________
Modified: svn:mergeinfo
17551764 Merged /trunk/phase3/includes/DefaultSettings.php:r93847,94990,94995-94996,95000-95002,95007,95010-95011,95016-95017
Index: branches/wmf/1.17wmf1/includes/HttpFunctions.php
@@ -361,7 +361,7 @@
362362 }
363363
364364 if ( is_object( $wgTitle ) && !isset( $this->reqHeaders['Referer'] ) ) {
365 - $this->setReferer( $wgTitle->getFullURL() );
 365+ $this->setReferer( wfExpandUrl( $wgTitle->getFullURL(), PROTO_CURRENT ) );
366366 }
367367
368368 if ( !$this->noProxy ) {
Index: branches/wmf/1.17wmf1/includes/specials/SpecialSearch.php
@@ -706,13 +706,13 @@
707707 $out = "";
708708 // display project name
709709 if(is_null($lastInterwiki) || $lastInterwiki != $t->getInterwiki()) {
710 - if( key_exists($t->getInterwiki(),$customCaptions) )
 710+ if( array_key_exists($t->getInterwiki(),$customCaptions) )
711711 // captions from 'search-interwiki-custom'
712712 $caption = $customCaptions[$t->getInterwiki()];
713713 else{
714714 // default is to show the hostname of the other wiki which might suck
715715 // if there are many wikis on one hostname
716 - $parsed = parse_url($t->getFullURL());
 716+ $parsed = wfParseUrl( $t->getFullURL() );
717717 $caption = wfMsg('search-interwiki-default', $parsed['host']);
718718 }
719719 // "more results" link (special page stuff could be localized, but we might not know target lang)
Property changes on: branches/wmf/1.17wmf1/includes/specials/SpecialSearch.php
___________________________________________________________________
Modified: svn:mergeinfo
720720 Merged /trunk/phase3/includes/specials/SpecialSearch.php:r94990,94996,95011,95016-95017
Index: branches/wmf/1.17wmf1/includes/Skin.php
@@ -224,7 +224,7 @@
225225 $out->addLink( array(
226226 'rel' => 'EditURI',
227227 'type' => 'application/rsd+xml',
228 - 'href' => wfExpandUrl( wfAppendQuery( wfScript( 'api' ), array( 'action' => 'rsd' ) ) ),
 228+ 'href' => wfExpandUrl( wfAppendQuery( wfScript( 'api' ), array( 'action' => 'rsd' ) ), PROTO_RELATIVE ),
229229 ) );
230230 }
231231
Property changes on: branches/wmf/1.17wmf1/includes/Skin.php
___________________________________________________________________
Modified: svn:mergeinfo
232232 Merged /trunk/phase3/includes/Skin.php:r94990,94996
Index: branches/wmf/1.17wmf1/opensearch_desc.php
@@ -51,7 +51,7 @@
5252 'height' => 16,
5353 'width' => 16,
5454 'type' => 'image/x-icon' ),
55 - wfExpandUrl( $wgFavicon ) );
 55+ wfExpandUrl( $wgFavicon , PROTO_CURRENT ) );
5656
5757 $urls = array();
5858
@@ -62,7 +62,7 @@
6363 $urls[] = array(
6464 'type' => 'text/html',
6565 'method' => 'get',
66 - 'template' => $searchPage->getFullURL( 'search={searchTerms}' ) );
 66+ 'template' => $searchPage->getCanonicalURL( 'search={searchTerms}' ) );
6767
6868 if( $wgEnableAPI ) {
6969 // JSON interface for search suggestions.
@@ -86,6 +86,6 @@
8787 // sends you to the domain root if you hit "enter" with an empty
8888 // search box.
8989 print Xml::element( 'moz:SearchForm', null,
90 - $searchPage->getFullUrl() );
 90+ $searchPage->getCanonicalURL() );
9191
9292 print '</OpenSearchDescription>';
Index: branches/wmf/1.17wmf1/languages/messages/MessagesEn.php
@@ -319,6 +319,8 @@
320320 'plural' => array( 0, 'PLURAL:' ),
321321 'fullurl' => array( 0, 'FULLURL:' ),
322322 'fullurle' => array( 0, 'FULLURLE:' ),
 323+ 'canonicalurl' => array( 0, 'CANONICALURL:' ),
 324+ 'canonicalurle' => array( 0, 'CANONICALURLE:' ),
323325 'lcfirst' => array( 0, 'LCFIRST:' ),
324326 'ucfirst' => array( 0, 'UCFIRST:' ),
325327 'lc' => array( 0, 'LC:' ),
@@ -2709,16 +2711,16 @@
27102712
27112713 --
27122714 To change your email notification settings, visit
2713 -{{fullurl:{{#special:Preferences}}}}
 2715+{{canonicalurl:{{#special:Preferences}}}}
27142716
27152717 To change your watchlist settings, visit
2716 -{{fullurl:{{#special:Watchlist}}/edit}}
 2718+{{canonicalurl:{{#special:Watchlist}}/edit}}
27172719
27182720 To delete the page from your watchlist, visit
27192721 $UNWATCHURL
27202722
27212723 Feedback and further assistance:
2722 -{{fullurl:{{MediaWiki:Helppage}}}}',
 2724+{{canonicalurl:{{MediaWiki:Helppage}}}}',
27232725
27242726 # Delete
27252727 'deletepage' => 'Delete page',
Property changes on: branches/wmf/1.17wmf1/languages/messages/MessagesEn.php
___________________________________________________________________
Modified: svn:mergeinfo
27262728 Merged /trunk/phase3/languages/messages/MessagesEn.php:r94995-94996,95000-95002,95007,95017

Follow-up revisions

RevisionCommit summaryAuthorDate
r955641.17wmf1: Fix merge snafu from r95505catrope17:29, 26 August 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r93847Follow-up r93258, r93266, r93266: Move the defines to Defines.phpplatonides18:25, 3 August 2011
r94990Followup r94754: move protocol expansion from getIRCLine() to inside getInter...catrope08:56, 19 August 2011
r94995Per CR on r44412 and my promise in the commit summary of r94990, stop abusing...catrope11:23, 19 August 2011
r94996Reverse a bad decision in r93820, which added a comment to WebRequest::getFul...catrope13:25, 19 August 2011
r95000Use canonical URLs (introduced in r94995) in the OpenSearch discovery thingycatrope14:39, 19 August 2011
r95001Make $wgVaryOnXFPForAPI apply to RSS/Atom feeds too, because they too use PRO...catrope14:41, 19 August 2011
r95002Use canonical URLs (introduced in r94995) for all URLs in e-mailscatrope14:46, 19 August 2011
r95006Add a PROTO_CANONICAL mode to wfExpandUrl(), which uses $wgCanonicalServercatrope15:25, 19 August 2011
r95007* Introduce File::getCanonicalUrl()...catrope15:27, 19 August 2011
r95010Make the PROTO_ parameter to wfExpandUrl() explicit in all calls. There are n...catrope15:46, 19 August 2011
r95011Use wfParseUrl() instead of parse_url() in interwiki search code: the latter ...catrope15:56, 19 August 2011
r95014Use getInternalUrl() instead of getFullUrl() in purgeList.php . This was pote...catrope17:20, 19 August 2011
r95016Expand some more URLs: for feeds, referers and the proxy scriptcatrope17:31, 19 August 2011
r95017Use canonical URLs in sitemaps, diff stuff and external edit stuffcatrope17:33, 19 August 2011

Comments

#Comment by Brion VIBBER (talk | contribs)   17:46, 31 August 2011

Merge of r95002 seems to cause bugzilla:30647

#Comment by MZMcBride (talk | contribs)   19:16, 31 August 2011

Likely fixed by Roan in r95894. Can this revision be marked as "new" or "resolved" now?

#Comment by Brion VIBBER (talk | contribs)   19:24, 31 August 2011

Now that it's been merged in r95903, yes. :D

Status & tagging log