http://www.mediawiki.org/wiki/Special:Code/MediaWiki/95016
Revision: 95016
Author: catrope
Date: 2011-08-19 17:31:40 +0000 (Fri, 19 Aug 2011)
Log Message:
-----------
Expand some more URLs: for feeds, referers and the proxy script
Modified Paths:
--------------
trunk/phase3/includes/Feed.php
trunk/phase3/includes/HttpFunctions.php
trunk/phase3/includes/ProxyTools.php
Modified: trunk/phase3/includes/Feed.php
===================================================================
--- trunk/phase3/includes/Feed.php 2011-08-19 17:31:35 UTC (rev 95015)
+++ trunk/phase3/includes/Feed.php 2011-08-19 17:31:40 UTC (rev 95016)
@@ -308,7 +308,7 @@
?><rss version="2.0"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title><?php print $this->getTitle() ?></title>
- <link><?php print $this->getUrl() ?></link>
+ <link><?php print wfExpandUrl( $this->getUrl(), PROTO_CURRENT )
?></link>
<description><?php print $this->getDescription()
?></description>
<language><?php print $this->getLanguage() ?></language>
<generator>MediaWiki <?php print $wgVersion ?></generator>
@@ -324,12 +324,12 @@
?>
<item>
<title><?php print $item->getTitle() ?></title>
- <link><?php print $item->getUrl() ?></link>
+ <link><?php print wfExpandUrl( $item->getUrl(),
PROTO_CURRENT ) ?></link>
<guid<?php if( !$item->RSSIsPermalink ) print '
isPermaLink="false"' ?>><?php print $item->getUniqueId() ?></guid>
<description><?php print $item->getDescription()
?></description>
<?php if( $item->getDate() ) { ?><pubDate><?php print
$this->formatTime( $item->getDate() ) ?></pubDate><?php } ?>
<?php if( $item->getAuthor() ) { ?><dc:creator><?php
print $item->getAuthor() ?></dc:creator><?php }?>
- <?php if( $item->getComments() ) { ?><comments><?php
print $item->getComments() ?></comments><?php }?>
+ <?php if( $item->getComments() ) { ?><comments><?php
print wfExpandUrl( $item->getComments(), PROTO_CURRENT ) ?></comments><?php }?>
</item>
<?php
}
@@ -368,8 +368,8 @@
?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="<?php
print $this->getLanguage() ?>">
<id><?php print $this->getFeedId() ?></id>
<title><?php print $this->getTitle() ?></title>
- <link rel="self" type="application/atom+xml" href="<?php print
$this->getSelfUrl() ?>"/>
- <link rel="alternate" type="text/html" href="<?php print
$this->getUrl() ?>"/>
+ <link rel="self" type="application/atom+xml" href="<?php print
wfExpandUrl( $this->getSelfUrl(), PROTO_CURRENT ) ?>"/>
+ <link rel="alternate" type="text/html" href="<?php print
wfExpandUrl( $this->getUrl(), PROTO_CURRENT ) ?>"/>
<updated><?php print $this->formatTime( wfTimestampNow() )
?>Z</updated>
<subtitle><?php print $this->getDescription() ?></subtitle>
<generator>MediaWiki <?php print $wgVersion ?></generator>
@@ -410,7 +410,7 @@
<entry>
<id><?php print $item->getUniqueId() ?></id>
<title><?php print $item->getTitle() ?></title>
- <link rel="alternate" type="<?php print $wgMimeType ?>"
href="<?php print $item->getUrl() ?>"/>
+ <link rel="alternate" type="<?php print $wgMimeType ?>"
href="<?php print wfExpandUrl( $item->getUrl(), PROTO_CURRENT ) ?>"/>
<?php if( $item->getDate() ) { ?>
<updated><?php print $this->formatTime( $item->getDate() )
?>Z</updated>
<?php } ?>
Modified: trunk/phase3/includes/HttpFunctions.php
===================================================================
--- trunk/phase3/includes/HttpFunctions.php 2011-08-19 17:31:35 UTC (rev
95015)
+++ trunk/phase3/includes/HttpFunctions.php 2011-08-19 17:31:40 UTC (rev
95016)
@@ -381,7 +381,7 @@
}
if ( is_object( $wgTitle ) && !isset(
$this->reqHeaders['Referer'] ) ) {
- $this->setReferer( $wgTitle->getFullURL() );
+ $this->setReferer( wfExpandUrl( $wgTitle->getFullURL(),
PROTO_CURRENT ) );
}
if ( !$this->noProxy ) {
Modified: trunk/phase3/includes/ProxyTools.php
===================================================================
--- trunk/phase3/includes/ProxyTools.php 2011-08-19 17:31:35 UTC (rev
95015)
+++ trunk/phase3/includes/ProxyTools.php 2011-08-19 17:31:40 UTC (rev
95016)
@@ -83,7 +83,7 @@
if ( !$skip ) {
$title = SpecialPage::getTitleFor( 'Blockme' );
$iphash = md5( $ip . $wgProxyKey );
- $url = $title->getFullURL( 'ip='.$iphash );
+ $url = wfExpandUrl( $title->getFullURL( 'ip='.$iphash ),
PROTO_HTTP );
foreach ( $wgProxyPorts as $port ) {
$params = implode( ' ', array(
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs