http://www.mediawiki.org/wiki/Special:Code/MediaWiki/97772

Revision: 97772
Author:   brion
Date:     2011-09-22 00:11:03 +0000 (Thu, 22 Sep 2011)
Log Message:
-----------
* (bug 30041) Fix memcached validation in installer to accept resolvable 
hostnames

'localhost:11211' was rejected because 'localhost' isn't an IP address... 
however it's a perfectly legit host to connect to. :)

Followup to r82687 which introduced the IP address check.

Modified Paths:
--------------
    trunk/phase3/includes/installer/WebInstallerPage.php

Modified: trunk/phase3/includes/installer/WebInstallerPage.php
===================================================================
--- trunk/phase3/includes/installer/WebInstallerPage.php        2011-09-22 
00:06:56 UTC (rev 97771)
+++ trunk/phase3/includes/installer/WebInstallerPage.php        2011-09-22 
00:11:03 UTC (rev 97772)
@@ -1081,8 +1081,10 @@
                        }
 
                        foreach( $memcServers as $server ) {
-                               $memcParts = explode( ":", $server );
-                               if( !IP::isValid( $memcParts[0] ) ) {
+                               $memcParts = explode( ":", $server, 2 );
+                               if ( !isset( $memcParts[0] )
+                                               || ( !IP::isValid( 
$memcParts[0] )
+                                                       && ( gethostbyname( 
$memcParts[0] ) == $memcParts[0] ) ) ) {
                                        $this->parent->showError( 
'config-memcache-badip', $memcParts[0] );
                                        return false;
                                } elseif( !isset( $memcParts[1] )  ) {


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to