]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/includes/class-ftp.php
WordPress 3.3.2-scripts
[autoinstalls/wordpress.git] / wp-admin / includes / class-ftp.php
index 0bf25e9c7853cc3e1cbc3a6d0c2be5501933afc9..1e35e745317a2452e815ff2b9f50830f16c92c6a 100644 (file)
@@ -278,7 +278,10 @@ class ftp_base {
                $dns=@gethostbyaddr($host);
                if(!$ip) $ip=$host;
                if(!$dns) $dns=$host;
-                       if(ip2long($ip) === -1) {
+               // Validate the IPAddress PHP4 returns -1 for invalid, PHP5 false
+               // -1 === "255.255.255.255" which is the broadcast address which is also going to be invalid
+               $ipaslong = ip2long($ip);
+                       if ( ($ipaslong == false) || ($ipaslong === -1) ) {
                                $this->SendMSG("Wrong host name/address \"".$host."\"");
                                return FALSE;
                        }
@@ -492,7 +495,7 @@ class ftp_base {
                $this->_features=array();
                foreach($f as $k=>$v) {
                        $v=explode(" ", trim($v));
-                       $this->_features[array_shift($v)]=$v;;
+                       $this->_features[array_shift($v)]=$v;
                }
                return true;
        }