* (bug 22747) "Reveal my e-mail address in notification e-mails" preference is
now only displayed when relevant
* (bug 22772) {{#special:}} parser function now works with subpages
+* (bug 18664) Relative URIs in interwiki links cause failed redirects
+* (bug 19270) Relative URIs in interwiki links break interwiki transclusion
== API changes in 1.17 ==
* (bug 22738) Allow filtering by action type on query=logevent
/**
* Expand a potentially local URL to a fully-qualified URL. Assumes $wgServer
- * is correct. Also doesn't handle any type of relative URL except one
- * starting with a single "/": this won't work with current-path-relative URLs
- * like "subdir/foo.html", protocol-relative URLs like
- * "//en.wikipedia.org/wiki/", etc. TODO: improve this!
+ * and $wgProto are correct.
+ *
+ * @todo this won't work with current-path-relative URLs
+ * like "subdir/foo.html", etc.
*
* @param $url String: either fully-qualified or a local path + query
* @return string Fully-qualified URL
*/
function wfExpandUrl( $url ) {
- if( substr( $url, 0, 1 ) == '/' ) {
+ if( substr( $url, 0, 2 ) == '//' ) {
+ global $wgProto;
+ return $wgProto . ':' . $url;
+ } elseif( substr( $url, 0, 1 ) == '/' ) {
global $wgServer;
return $wgServer . $url;
} else {
* @returns mixed (bool)false on failure or a string on success
*/
public static function request( $method, $url, $options = array() ) {
+ $url = wfExpandUrl( $url );
wfDebug( "HTTP: $method: $url" );
$options['method'] = strtoupper( $method );
if ( !isset( $options['timeout'] ) ) {