r72459 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72458‎ | r72459 | r72460 >
Date:21:54, 5 September 2010
Author:jeluf
Status:ok (Comments)
Tags:
Comment:
Firefox interpretes links starting with // as if they would start with http://. If the wiki is installed in /, we get // as path
Modified paths:
  • /trunk/phase3/includes/templates/NoLocalSettings.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/templates/NoLocalSettings.php
@@ -11,6 +11,7 @@
1212 }
1313 $script = $_SERVER['SCRIPT_NAME'];
1414 $path = pathinfo( $script, PATHINFO_DIRNAME ) . '/';
 15+$path = str_replace( '//', '/', $path );
1516 $ext = pathinfo( $script, PATHINFO_EXTENSION );
1617 ?>
1718 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Comments

#Comment by Platonides (talk | contribs)   22:28, 5 September 2010

Not only that. We would have issues with it looking like a samba url.

#Comment by Nikerabbit (talk | contribs)   05:55, 6 September 2010

What issues would those be? I've been using //-links for a while now without any problems.

What comes to the commit message, it is not just Firefox, and it is not just http, but the protocol the page was served in.

#Comment by Simetrical (talk | contribs)   19:36, 6 September 2010

This is a "network-path reference", see RFC 3986 section 4.2: http://tools.ietf.org/html/rfc3986#section-4.2. //foo resolves to http://foo if the current page is HTTP, https://foo if it's HTTPS, file://foo if it's a local file, etc. It's supported consistently by all browsers AFAIK. If we ever get HTTPS working at the same URLs as HTTP, we'll probably switch all internal URLs to start with // instead of http://, so that we can serve the same HTML pages to HTTP and HTTPS users.

I can't wait to see how creatively Code Review mangles this post.

#Comment by Simetrical (talk | contribs)   19:36, 6 September 2010

Not mangled at all, thankfully.

#Comment by 😂 (talk | contribs)   15:04, 7 September 2010

That would be bug 20342 :)

Status & tagging log