X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/11be8dc178e77d0b46189bbd8e33a216a9b90942..HEAD:/wp-admin/includes/class-ftp-sockets.php diff --git a/wp-admin/includes/class-ftp-sockets.php b/wp-admin/includes/class-ftp-sockets.php index 4026dd0b..5ca4a2b5 100644 --- a/wp-admin/includes/class-ftp-sockets.php +++ b/wp-admin/includes/class-ftp-sockets.php @@ -3,13 +3,13 @@ * PemFTP - A Ftp implementation in pure PHP * * @package PemFTP - * @since 2.5 + * @since 2.5.0 * * @version 1.0 * @copyright Alexey Dotsenko * @author Alexey Dotsenko * @link http://www.phpclasses.org/browse/package/1743.html Site - * @license LGPL License http://www.opensource.org/licenses/lgpl-license.html + * @license LGPL http://www.opensource.org/licenses/lgpl-license.html */ /** @@ -17,19 +17,15 @@ * * @package PemFTP * @subpackage Socket - * @since 2.5 + * @since 2.5.0 * * @version 1.0 * @copyright Alexey Dotsenko * @author Alexey Dotsenko * @link http://www.phpclasses.org/browse/package/1743.html Site - * @license LGPL License http://www.opensource.org/licenses/lgpl-license.html + * @license LGPL http://www.opensource.org/licenses/lgpl-license.html */ -class ftp extends ftp_base { - - function ftp($verb=FALSE, $le=FALSE) { - $this->__construct($verb, $le); - } +class ftp_sockets extends ftp_base { function __construct($verb=FALSE, $le=FALSE) { parent::__construct(true, $verb, $le); @@ -131,9 +127,9 @@ class ftp extends ftp_base { $this->_data_close(); return FALSE; } - $ip_port = explode(",", ereg_replace("^.+ \\(?([0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]+,[0-9]+)\\)?.*".CRLF."$", "\\1", $this->_message)); + $ip_port = explode(",", preg_replace("/^.+ \\(?([0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]+,[0-9]+)\\)?.*$/s", "\\1", $this->_message)); $this->_datahost=$ip_port[0].".".$ip_port[1].".".$ip_port[2].".".$ip_port[3]; - $this->_dataport=(((int)$ip_port[4])<<8) + ((int)$ip_port[5]); + $this->_dataport=(((int)$ip_port[4])<<8) + ((int)$ip_port[5]); $this->SendMSG("Connecting to ".$this->_datahost.":".$this->_dataport); if(!@socket_connect($this->_ftp_data_sock, $this->_datahost, $this->_dataport)) { $this->PushError("_data_prepare","socket_connect", socket_strerror(socket_last_error($this->_ftp_data_sock)));