* @return Mixed: (bool)false on failure or a string on success
*/
public static function request( $method, $url, $options = array() ) {
- $url = wfExpandUrl( $url, PROT_HTTP );
+ $url = wfExpandUrl( $url, PROTO_HTTP );
wfDebug( "HTTP: $method: $url\n" );
$options['method'] = strtoupper( $method );
'type' => 'application/rsd+xml',
// Output a protocol-relative URL here if $wgServer is protocol-relative
// Whether RSD accepts relative or protocol-relative URLs is completely undocumented, though
- 'href' => wfExpandUrl( wfAppendQuery( wfScript( 'api' ), array( 'action' => 'rsd' ) ), PROT_RELATIVE ),
+ 'href' => wfExpandUrl( wfAppendQuery( wfScript( 'api' ), array( 'action' => 'rsd' ) ), PROTO_RELATIVE ),
) );
}
'$1',
"Special:$page/$token",
$wgArticlePath ),
- PROT_HTTP
+ PROTO_HTTP
);
}
public static function httpGet( $url, $timeout = 'default', $options = array() ) {
$options['timeout'] = $timeout;
/* Http::get */
- $url = wfExpandUrl( $url, PROT_HTTP );
+ $url = wfExpandUrl( $url, PROTO_HTTP );
wfDebug( "ForeignAPIRepo: HTTP GET: $url\n" );
$options['method'] = "GET";
$expanded = wfExpandUrl( $match['file'][0] );
$origLength = strlen( $match['file'][0] );
$lengthIncrease = strlen( $expanded ) - $origLength;
- $source = substr_replace( $source, wfExpandUrl( $match['file'][0], PROT_RELATIVE ),
+ $source = substr_replace( $source, wfExpandUrl( $match['file'][0], PROTO_RELATIVE ),
$match['file'][1], $origLength,
);
}
// ... and we can
if ( $mto && !$mto->isError() ) {
// ... change the URL to point to a thumbnail.
- $url = wfExpandUrl( $mto->getUrl(), PROT_RELATIVE );
+ $url = wfExpandUrl( $mto->getUrl(), PROTO_RELATIVE );
}
}
if ( $option == 'nowiki' ) {
}
// Make sure the remote base path is a complete valid URL,
// but possibly protocol-relative to avoid cache pollution
- $this->remoteBasePath = wfExpandUrl( $this->remoteBasePath, PROT_RELATIVE );
+ $this->remoteBasePath = wfExpandUrl( $this->remoteBasePath, PROTO_RELATIVE );
}
/**