wp/wp-admin/includes/class-ftp-pure.php
changeset 7 cf61fcea0001
parent 5 5e2f62d02dcd
child 9 177826044cd9
equal deleted inserted replaced
6:490d5cc509ed 7:cf61fcea0001
    23  * @copyright Alexey Dotsenko
    23  * @copyright Alexey Dotsenko
    24  * @author Alexey Dotsenko
    24  * @author Alexey Dotsenko
    25  * @link http://www.phpclasses.org/browse/package/1743.html Site
    25  * @link http://www.phpclasses.org/browse/package/1743.html Site
    26  * @license LGPL http://www.opensource.org/licenses/lgpl-license.html
    26  * @license LGPL http://www.opensource.org/licenses/lgpl-license.html
    27  */
    27  */
    28 class ftp extends ftp_base {
    28 class ftp_pure extends ftp_base {
    29 
       
    30 	function ftp($verb=FALSE, $le=FALSE) {
       
    31 		$this->__construct($verb, $le);
       
    32 	}
       
    33 
    29 
    34 	function __construct($verb=FALSE, $le=FALSE) {
    30 	function __construct($verb=FALSE, $le=FALSE) {
    35 		parent::__construct(false, $verb, $le);
    31 		parent::__construct(false, $verb, $le);
    36 	}
    32 	}
    37 
    33 
   108 			}
   104 			}
   109 			if(!$this->_checkCode()) {
   105 			if(!$this->_checkCode()) {
   110 				$this->_data_close();
   106 				$this->_data_close();
   111 				return FALSE;
   107 				return FALSE;
   112 			}
   108 			}
   113 			$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));
   109 			$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));
   114 			$this->_datahost=$ip_port[0].".".$ip_port[1].".".$ip_port[2].".".$ip_port[3];
   110 			$this->_datahost=$ip_port[0].".".$ip_port[1].".".$ip_port[2].".".$ip_port[3];
   115             $this->_dataport=(((int)$ip_port[4])<<8) + ((int)$ip_port[5]);
   111             $this->_dataport=(((int)$ip_port[4])<<8) + ((int)$ip_port[5]);
   116 			$this->SendMSG("Connecting to ".$this->_datahost.":".$this->_dataport);
   112 			$this->SendMSG("Connecting to ".$this->_datahost.":".$this->_dataport);
   117 			$this->_ftp_data_sock=@fsockopen($this->_datahost, $this->_dataport, $errno, $errstr, $this->_timeout);
   113 			$this->_ftp_data_sock=@fsockopen($this->_datahost, $this->_dataport, $errno, $errstr, $this->_timeout);
   118 			if(!$this->_ftp_data_sock) {
   114 			if(!$this->_ftp_data_sock) {