r88973 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88972‎ | r88973 | r88974 >
Date:16:14, 27 May 2011
Author:vyznev
Status:ok (Comments)
Tags:
Comment:
fix broken condition in r83847 (tested)
Modified paths:
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/DefaultSettings.php
@@ -55,10 +55,10 @@
5656
5757 /** @cond file_level_code */
5858 if( isset( $_SERVER['SERVER_NAME'] )
59 - # additionially, for requests made directly to an IPv6 address we have
60 - # to make sure the server enclose it in either [] or nothing at all
61 - && (strpos($_SERVER['SERVER_NAME'], '[')
62 - xor strpos( $_SERVER['SERVER_NAME'], ']'))
 59+ # KLUGE: lighttpd 1.4.28 truncates IPv6 addresses at the first colon,
 60+ # giving bogus hostnames like "[2001"; check for presence of both
 61+ # brackets to detect this.
 62+ && ($_SERVER['SERVER_NAME'][0] !== '[' || substr($_SERVER['SERVER_NAME'], -1) === ']')
6363 ) {
6464 $serverName = $_SERVER['SERVER_NAME'];
6565 } elseif( isset( $_SERVER['HOSTNAME'] ) ) {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r83847setting servername with an IPv6 request must ensure we have both brackets...hashar18:31, 13 March 2011

Comments

#Comment by Ilmari Karonen (talk | contribs)   16:16, 27 May 2011

I didn't actually check that it does what it it's intended to do (as I don't happen to have a broken lighttpd installation handy to test on), but at least it no longer breaks normal operation on my hosting provider's Apache.

Status & tagging log