http://www.mediawiki.org/wiki/Special:Code/MediaWiki/95663
Revision: 95663
Author: catrope
Date: 2011-08-29 14:37:47 +0000 (Mon, 29 Aug 2011)
Log Message:
-----------
Last commit to make WMF-deployed extensions HTTPS-ready (hopefully): use
wfExpandUrl() in a bunch of places
* SpamBlacklist: code is weird but I'm pretty sure this needs HTTP
* ContributionTracking: expand return URL to current protocol. Use HTTP in the
test suite (PROTO_CURRENT makes no sense in tests since they run from the
command line)
* GlobalUsage: remove URL expansion, not needed after r95651
* CentralNotice: expand URL because it gets fed to window.location indirectly
via JS
* OpenSearhXml: use canonical URLs in XML output
* MobileFrontend: expand a URL that's used in a Location: header
Modified Paths:
--------------
trunk/extensions/CentralNotice/special/SpecialCentralNoticeLogs.php
trunk/extensions/ContributionTracking/ContributionTracking.processor.php
trunk/extensions/ContributionTracking/tests/ContributionTrackingAPITest.php
trunk/extensions/ContributionTracking/tests/ContributionTrackingProcessorTest.php
trunk/extensions/ContributionTracking/tests/ContributionTrackingTest.php
trunk/extensions/GlobalUsage/ApiQueryGlobalUsage.php
trunk/extensions/MobileFrontend/MobileFrontend.php
trunk/extensions/OpenSearchXml/ApiOpenSearchXml.php
trunk/extensions/SpamBlacklist/SpamBlacklist_body.php
Modified: trunk/extensions/CentralNotice/special/SpecialCentralNoticeLogs.php
===================================================================
--- trunk/extensions/CentralNotice/special/SpecialCentralNoticeLogs.php
2011-08-29 14:16:27 UTC (rev 95662)
+++ trunk/extensions/CentralNotice/special/SpecialCentralNoticeLogs.php
2011-08-29 14:37:47 UTC (rev 95663)
@@ -53,7 +53,7 @@
$htmlOut .= Xml::element( 'h2', null, wfMsg(
'centralnotice-view-logs' ) );
$htmlOut .= Xml::openElement( 'div', array( 'id' =>
'cn-log-switcher' ) );
$title = SpecialPage::getTitleFor( 'CentralNoticeLogs' );
- $fullUrl = $title->getFullUrl();
+ $fullUrl = wfExpandUrl( $title->getFullUrl(), PROTO_CURRENT );
$htmlOut .= Xml::radio(
'log_type',
Modified:
trunk/extensions/ContributionTracking/ContributionTracking.processor.php
===================================================================
--- trunk/extensions/ContributionTracking/ContributionTracking.processor.php
2011-08-29 14:16:27 UTC (rev 95662)
+++ trunk/extensions/ContributionTracking/ContributionTracking.processor.php
2011-08-29 14:37:47 UTC (rev 95663)
@@ -322,7 +322,7 @@
$returnText = $input['return'];
$returnTitle = Title::newFromText( $returnText );
if ( $returnTitle ) {
- $returnto = $returnTitle->getFullUrl();
+ $returnto = wfExpandUrl(
$returnTitle->getFullUrl(), PROTO_CURRENT );
} else {
$returnto =
$wgContributionTrackingReturnToURLDefault . "/$language";
}
Modified:
trunk/extensions/ContributionTracking/tests/ContributionTrackingAPITest.php
===================================================================
--- trunk/extensions/ContributionTracking/tests/ContributionTrackingAPITest.php
2011-08-29 14:16:27 UTC (rev 95662)
+++ trunk/extensions/ContributionTracking/tests/ContributionTrackingAPITest.php
2011-08-29 14:37:47 UTC (rev 95663)
@@ -90,7 +90,7 @@
'business' => '[email protected]',
'item_number' => 'DONATE',
'no_note' => 0,
- 'return' => $returnTitle->getFullUrl(),
+ 'return' => wfExpandUrl(
$returnTitle->getFullUrl(), PROTO_HTTP ),
'currency_code' => 'USD',
'cmd' => '_xclick',
'notify_url' =>
'https://civicrm.wikimedia.org/fundcore_gateway/paypal',
@@ -124,7 +124,7 @@
'business' => '[email protected]',
'item_number' => 'DONATE',
'no_note' => 0,
- 'return' => $returnTitle->getFullUrl(),
+ 'return' => wfExpandUrl(
$returnTitle->getFullUrl(), PROTO_HTTP ),
'currency_code' => 'USD',
'cmd' => '_xclick',
'notify_url' =>
'https://civicrm.wikimedia.org/fundcore_gateway/paypal',
@@ -171,7 +171,7 @@
'business' => '[email protected]',
'item_number' => 'DONATE',
'no_note' => 0,
- 'return' => $returnTitle->getFullUrl(),
//Important to the language test.
+ 'return' => wfExpandUrl(
$returnTitle->getFullUrl(), PROTO_HTTP ), //Important to the language test.
'currency_code' => 'USD',
'cmd' => '_xclick',
'notify_url' =>
'https://civicrm.wikimedia.org/fundcore_gateway/paypal',
@@ -209,7 +209,7 @@
'business' => '[email protected]',
'item_number' => 'DONATE',
'no_note' => 0,
- 'return' => $returnTitle->getFullUrl(),
+ 'return' => wfExpandUrl(
$returnTitle->getFullUrl(), PROTO_HTTP ),
'currency_code' => 'USD',
'cmd' => '_xclick',
'notify_url' =>
'https://civicrm.wikimedia.org/fundcore_gateway/paypal',
Modified:
trunk/extensions/ContributionTracking/tests/ContributionTrackingProcessorTest.php
===================================================================
---
trunk/extensions/ContributionTracking/tests/ContributionTrackingProcessorTest.php
2011-08-29 14:16:27 UTC (rev 95662)
+++
trunk/extensions/ContributionTracking/tests/ContributionTrackingProcessorTest.php
2011-08-29 14:37:47 UTC (rev 95663)
@@ -196,7 +196,7 @@
'business' => '[email protected]',
'item_number' => 'DONATE',
'no_note' => 0,
- 'return' => $returnTitle->getFullUrl(),
+ 'return' => wfExpandUrl(
$returnTitle->getFullUrl(), PROTO_HTTP ),
'currency_code' => 'USD',
'cmd' => '_xclick',
'notify_url' =>
'https://civicrm.wikimedia.org/fundcore_gateway/paypal',
@@ -261,7 +261,7 @@
'business' => '[email protected]',
'item_number' => 'DONATE',
'no_note' => 0,
- 'return' => $returnTitle->getFullURL(),
//Important to the language test.
+ 'return' => wfExpandUrl(
$returnTitle->getFullUrl(), PROTO_HTTP ), //Important to the language test.
'currency_code' => 'USD',
'cmd' => '_xclick',
'notify_url' =>
'https://civicrm.wikimedia.org/fundcore_gateway/paypal',
@@ -288,7 +288,7 @@
'business' => '[email protected]',
'item_number' => 'DONATE',
'no_note' => 0,
- 'return' => $returnTitle->getFullURL(),
+ 'return' => wfExpandUrl(
$returnTitle->getFullUrl(), PROTO_HTTP ),
'currency_code' => 'USD',
'cmd' => '_xclick',
'notify_url' =>
'https://civicrm.wikimedia.org/fundcore_gateway/paypal',
Modified:
trunk/extensions/ContributionTracking/tests/ContributionTrackingTest.php
===================================================================
--- trunk/extensions/ContributionTracking/tests/ContributionTrackingTest.php
2011-08-29 14:16:27 UTC (rev 95662)
+++ trunk/extensions/ContributionTracking/tests/ContributionTrackingTest.php
2011-08-29 14:37:47 UTC (rev 95663)
@@ -113,7 +113,7 @@
'business' => '[email protected]',
'item_number' => 'DONATE',
'no_note' => 0,
- 'return' => $returnTitle->getFullUrl(),
+ 'return' => wfExpandUrl(
$returnTitle->getFullUrl(), PROTO_HTTP ),
'currency_code' => 'USD',
'cmd' => '_xclick',
'notify_url' =>
'https://civicrm.wikimedia.org/fundcore_gateway/paypal',
@@ -147,7 +147,7 @@
'business' => '[email protected]',
'item_number' => 'DONATE',
'no_note' => 0,
- 'return' => $returnTitle->getFullUrl(),
+ 'return' => wfExpandUrl(
$returnTitle->getFullUrl(), PROTO_HTTP ),
'currency_code' => 'USD',
'cmd' => '_xclick',
'notify_url' =>
'https://civicrm.wikimedia.org/fundcore_gateway/paypal',
@@ -194,7 +194,7 @@
'business' => '[email protected]',
'item_number' => 'DONATE',
'no_note' => 0,
- 'return' => $returnTitle->getFullUrl(),
//Important to the language test.
+ 'return' => wfExpandUrl(
$returnTitle->getFullUrl(), PROTO_HTTP ), //Important to the language test.
'currency_code' => 'USD',
'cmd' => '_xclick',
'notify_url' =>
'https://civicrm.wikimedia.org/fundcore_gateway/paypal',
@@ -233,7 +233,7 @@
'business' => '[email protected]',
'item_number' => 'DONATE',
'no_note' => 0,
- 'return' => $returnTitle->getFullUrl(),
+ 'return' => wfExpandUrl(
$returnTitle->getFullUrl(), PROTO_HTTP ),
'currency_code' => 'USD',
'cmd' => '_xclick',
'notify_url' =>
'https://civicrm.wikimedia.org/fundcore_gateway/paypal',
Modified: trunk/extensions/GlobalUsage/ApiQueryGlobalUsage.php
===================================================================
--- trunk/extensions/GlobalUsage/ApiQueryGlobalUsage.php 2011-08-29
14:16:27 UTC (rev 95662)
+++ trunk/extensions/GlobalUsage/ApiQueryGlobalUsage.php 2011-08-29
14:37:47 UTC (rev 95663)
@@ -62,8 +62,7 @@
'wiki' =>
WikiMap::getWikiName( $wiki )
);
if ( isset( $prop['url'] ) ) {
- $result['url'] =
wfExpandUrl(
-
WikiMap::getForeignUrl( $item['wiki'], $title ) );
+ $result['url'] =
WikiMap::getForeignUrl( $item['wiki'], $title );
}
if ( isset( $prop['pageid'] ) )
{
$result['pageid'] =
$item['id'];
Modified: trunk/extensions/MobileFrontend/MobileFrontend.php
===================================================================
--- trunk/extensions/MobileFrontend/MobileFrontend.php 2011-08-29 14:16:27 UTC
(rev 95662)
+++ trunk/extensions/MobileFrontend/MobileFrontend.php 2011-08-29 14:37:47 UTC
(rev 95663)
@@ -327,7 +327,7 @@
if ( $mobileAction == 'opt_in_cookie' ) {
$this->setOptInOutCookie( '1' );
$this->disableCaching();
- $location = Title::newMainPage()->getFullURL();
+ $location = wfExpandUrl(
Title::newMainPage()->getFullURL(), PROTO_CURRENT );
$wgRequest->response()->header( 'Location: ' .
$location );
}
Modified: trunk/extensions/OpenSearchXml/ApiOpenSearchXml.php
===================================================================
--- trunk/extensions/OpenSearchXml/ApiOpenSearchXml.php 2011-08-29 14:16:27 UTC
(rev 95662)
+++ trunk/extensions/OpenSearchXml/ApiOpenSearchXml.php 2011-08-29 14:37:47 UTC
(rev 95663)
@@ -122,11 +122,11 @@
$item = array();
$item['Text']['*'] = $title->getPrefixedText();
$item['Description']['*'] = $extract;
- $item['Url']['*'] = $title->getFullUrl();
+ $item['Url']['*'] = wfExpandUrl( $title->getFullUrl(),
PROTO_CURRENT );
if( $image ) {
$thumb = $image->transform( array( 'width' =>
50, 'height' => 50 ), 0 );
$item['Image'] = array(
- 'source' => wfExpandUrl(
$thumb->getUrl() ),
+ 'source' => wfExpandUrl(
$thumb->getUrl(), PROTO_CANONICAL ),
//alt
'width' => $thumb->getWidth(),
'height' => $thumb->getHeight() );
Modified: trunk/extensions/SpamBlacklist/SpamBlacklist_body.php
===================================================================
--- trunk/extensions/SpamBlacklist/SpamBlacklist_body.php 2011-08-29
14:16:27 UTC (rev 95662)
+++ trunk/extensions/SpamBlacklist/SpamBlacklist_body.php 2011-08-29
14:37:47 UTC (rev 95663)
@@ -35,7 +35,7 @@
}
}
- $thisHttp = $title->getFullUrl( 'action=raw' );
+ $thisHttp = wfExpandUrl( $title->getFullUrl( 'action=raw' ),
PROT_HTTP );
$thisHttpRegex = '/^' . preg_quote( $thisHttp, '/' ) .
'(?:&.*)?$/';
foreach( $this->files as $fileName ) {
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs