mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-09 01:48:21 +01:00
Fix the IP Address validation code in the FTP class. Fixes #11393 props nacin.
git-svn-id: http://svn.automattic.com/wordpress/trunk@12387 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
563550f038
commit
7a443a7b6e
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user