]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/includes/class-ftp-pure.php
WordPress 4.6.3
[autoinstalls/wordpress.git] / wp-admin / includes / class-ftp-pure.php
index 5ef92bfddac2404a9b4400ccb83c0c696c0bca4d..28e56779f97edd2607b1c578ff6ef39cdaac05b3 100644 (file)
@@ -3,24 +3,38 @@
  * 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
  */
-class ftp extends ftp_base {
 
-       function ftp($verb=FALSE, $le=FALSE) {
-               $this->__construct($verb, $le);
-       }
+/**
+ * FTP implementation using fsockopen to connect.
+ *
+ * @package PemFTP
+ * @subpackage Pure
+ * @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 http://www.opensource.org/licenses/lgpl-license.html
+ */
+class ftp extends ftp_base {
 
        function __construct($verb=FALSE, $le=FALSE) {
                parent::__construct(false, $verb, $le);
        }
 
+       function ftp($verb=FALSE, $le=FALSE) {
+               $this->__construct($verb, $le);
+       }
+
 // <!-- --------------------------------------------------------------------------------------- -->
 // <!--       Private functions                                                                 -->
 // <!-- --------------------------------------------------------------------------------------- -->
@@ -96,7 +110,7 @@ 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->SendMSG("Connecting to ".$this->_datahost.":".$this->_dataport);
@@ -172,4 +186,5 @@ class ftp extends ftp_base {
                }
        }
 }
+
 ?>