From: Brion Vibber Date: Thu, 22 Sep 2011 00:11:03 +0000 (+0000) Subject: * (bug 30041) Fix memcached validation in installer to accept resolvable hostnames X-Git-Tag: 1.31.0-rc.0~27493 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=ee8b63310b11a1b0bdf94b0ee2732926aedb3a97;p=lhc%2Fweb%2Fwiklou.git * (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. --- diff --git a/includes/installer/WebInstallerPage.php b/includes/installer/WebInstallerPage.php index 4d83991122..31326062fb 100644 --- a/includes/installer/WebInstallerPage.php +++ b/includes/installer/WebInstallerPage.php @@ -1081,8 +1081,10 @@ class WebInstaller_Options extends WebInstallerPage { } 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] ) ) {