WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/18/2015 08:19:18 AM (6 years ago)
Author:
dd32
Message:

Updates: FTP/PemFTP Library: Remove the usage of deprecated regular expression functions (ereg replaced by PCRE).

Props enshrined, aaroncampbell
Fixes #16026, #33432

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-ftp-sockets.php

    r32990 r34281  
    132132                return FALSE;
    133133            }
    134             $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));
     134            $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));
    135135            $this->_datahost=$ip_port[0].".".$ip_port[1].".".$ip_port[2].".".$ip_port[3];
    136             $this->_dataport=(((int)$ip_port[4])<<8) + ((int)$ip_port[5]);
     136            $this->_dataport=(((int)$ip_port[4])<<8) + ((int)$ip_port[5]);
    137137            $this->SendMSG("Connecting to ".$this->_datahost.":".$this->_dataport);
    138138            if(!@socket_connect($this->_ftp_data_sock, $this->_datahost, $this->_dataport)) {
Note: See TracChangeset for help on using the changeset viewer.