From efa0a5013f248e839a8ce729b02bc8f282f3fb44 Mon Sep 17 00:00:00 2001 From: Platonides Date: Wed, 27 Jul 2011 14:06:43 +0000 Subject: [PATCH] Rename PROT_* constants to PROTO_* Follow up r93258 --- includes/GlobalFunctions.php | 14 +++++++------- .../includes/GlobalFunctions/wfExpandUrl.php | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 3c893b04c2..51861e3c89 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -428,10 +428,10 @@ function wfAppendQuery( $url, $query ) { return $url; } -define( 'PROT_HTTP', 'http://' ); -define( 'PROT_HTTPS', 'https://' ); -define( 'PROT_RELATIVE', '//' ); -define( 'PROT_CURRENT', null ); +define( 'PROTO_HTTP', 'http://' ); +define( 'PROTO_HTTPS', 'https://' ); +define( 'PROTO_RELATIVE', '//' ); +define( 'PROTO_CURRENT', null ); /** * Expand a potentially local URL to a fully-qualified URL. Assumes $wgServer @@ -447,12 +447,12 @@ define( 'PROT_CURRENT', null ); * like "subdir/foo.html", etc. * * @param $url String: either fully-qualified or a local path + query - * @param $defaultProto Mixed: one of the PROT_* constants. Determines the protocol to use if $url or $wgServer is protocol-relative + * @param $defaultProto Mixed: one of the PROTO_* constants. Determines the protocol to use if $url or $wgServer is protocol-relative * @return string Fully-qualified URL */ -function wfExpandUrl( $url, $defaultProto = PROT_CURRENT ) { +function wfExpandUrl( $url, $defaultProto = PROTO_CURRENT ) { global $wgServer; - if ( $defaultProto === PROT_CURRENT ) { + if ( $defaultProto === PROTO_CURRENT ) { $defaultProto = WebRequest::detectProtocol() . '://'; } diff --git a/tests/phpunit/includes/GlobalFunctions/wfExpandUrl.php b/tests/phpunit/includes/GlobalFunctions/wfExpandUrl.php index fe60bdc80b..f71ace658d 100644 --- a/tests/phpunit/includes/GlobalFunctions/wfExpandUrl.php +++ b/tests/phpunit/includes/GlobalFunctions/wfExpandUrl.php @@ -32,7 +32,7 @@ class wfExpandUrl extends MediaWikiTestCase { public function provideExpandableUrls() { $modes = array( 'http', 'https' ); $servers = array( 'http' => 'http://example.com', 'https' => 'https://example.com', 'protocol-relative' => '//example.com' ); - $defaultProtos = array( 'http' => PROT_HTTP, 'https' => PROT_HTTPS, 'protocol-relative' => PROT_RELATIVE, 'current' => PROT_CURRENT ); + $defaultProtos = array( 'http' => PROTO_HTTP, 'https' => PROTO_HTTPS, 'protocol-relative' => PROTO_RELATIVE, 'current' => PROTO_CURRENT ); $retval = array(); foreach ( $modes as $mode ) { -- 2.20.1