r93266 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93265‎ | r93266 | r93267 >
Date:14:06, 27 July 2011
Author:platonides
Status:ok
Tags:
Comment:
Rename PROT_* constants to PROTO_*
Follow up r93258
Modified paths:
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)
  • /trunk/phase3/tests/phpunit/includes/GlobalFunctions/wfExpandUrl.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/GlobalFunctions/wfExpandUrl.php
@@ -32,7 +32,7 @@
3333 public function provideExpandableUrls() {
3434 $modes = array( 'http', 'https' );
3535 $servers = array( 'http' => 'http://example.com', 'https' => 'https://example.com', 'protocol-relative' => '//example.com' );
36 - $defaultProtos = array( 'http' => PROT_HTTP, 'https' => PROT_HTTPS, 'protocol-relative' => PROT_RELATIVE, 'current' => PROT_CURRENT );
 36+ $defaultProtos = array( 'http' => PROTO_HTTP, 'https' => PROTO_HTTPS, 'protocol-relative' => PROTO_RELATIVE, 'current' => PROTO_CURRENT );
3737
3838 $retval = array();
3939 foreach ( $modes as $mode ) {
Index: trunk/phase3/includes/GlobalFunctions.php
@@ -428,10 +428,10 @@
429429 return $url;
430430 }
431431
432 -define( 'PROT_HTTP', 'http://' );
433 -define( 'PROT_HTTPS', 'https://' );
434 -define( 'PROT_RELATIVE', '//' );
435 -define( 'PROT_CURRENT', null );
 432+define( 'PROTO_HTTP', 'http://' );
 433+define( 'PROTO_HTTPS', 'https://' );
 434+define( 'PROTO_RELATIVE', '//' );
 435+define( 'PROTO_CURRENT', null );
436436
437437 /**
438438 * Expand a potentially local URL to a fully-qualified URL. Assumes $wgServer
@@ -447,12 +447,12 @@
448448 * like "subdir/foo.html", etc.
449449 *
450450 * @param $url String: either fully-qualified or a local path + query
451 - * @param $defaultProto Mixed: one of the PROT_* constants. Determines the protocol to use if $url or $wgServer is protocol-relative
 451+ * @param $defaultProto Mixed: one of the PROTO_* constants. Determines the protocol to use if $url or $wgServer is protocol-relative
452452 * @return string Fully-qualified URL
453453 */
454 -function wfExpandUrl( $url, $defaultProto = PROT_CURRENT ) {
 454+function wfExpandUrl( $url, $defaultProto = PROTO_CURRENT ) {
455455 global $wgServer;
456 - if ( $defaultProto === PROT_CURRENT ) {
 456+ if ( $defaultProto === PROTO_CURRENT ) {
457457 $defaultProto = WebRequest::detectProtocol() . '://';
458458 }
459459

Follow-up revisions

RevisionCommit summaryAuthorDate
r93819Followup r93266: also rename PROT_* to PROTO_* in the commentscatrope12:52, 3 August 2011
r93847Follow-up r93258, r93266, r93266: Move the defines to Defines.phpplatonides18:25, 3 August 2011
r94472MFT to REL1_18:...hashar19:43, 14 August 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r93258(bug NNNNN) Rewrite most of wfExpandUrl() to handle protocol-relative URLs pr...catrope08:21, 27 July 2011

Status & tagging log