mirror of
https://github.com/WordPress/WordPress.git
synced 2025-03-09 07:00:01 +00:00
Updates: FTP/PemFTP Library: Remove the usage of deprecated regular expression functions (ereg replaced by PCRE).
Props enshrined, aaroncampbell Fixes #16026, #33432 Built from https://develop.svn.wordpress.org/trunk@34281 git-svn-id: http://core.svn.wordpress.org/trunk@34245 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
3ed914175a
commit
5abc1eaab9
@ -110,7 +110,7 @@ class ftp extends ftp_base {
|
|||||||
$this->_data_close();
|
$this->_data_close();
|
||||||
return FALSE;
|
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->_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);
|
$this->SendMSG("Connecting to ".$this->_datahost.":".$this->_dataport);
|
||||||
|
@ -131,7 +131,7 @@ class ftp extends ftp_base {
|
|||||||
$this->_data_close();
|
$this->_data_close();
|
||||||
return FALSE;
|
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->_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);
|
$this->SendMSG("Connecting to ".$this->_datahost.":".$this->_dataport);
|
||||||
|
@ -380,7 +380,7 @@ class ftp_base {
|
|||||||
function pwd() {
|
function pwd() {
|
||||||
if(!$this->_exec("PWD", "pwd")) return FALSE;
|
if(!$this->_exec("PWD", "pwd")) return FALSE;
|
||||||
if(!$this->_checkCode()) return FALSE;
|
if(!$this->_checkCode()) return FALSE;
|
||||||
return ereg_replace("^[0-9]{3} \"(.+)\".+", "\\1", $this->_message);
|
return preg_replace("/^[0-9]{3} \"(.+)\".*$/s", "\\1", $this->_message);
|
||||||
}
|
}
|
||||||
|
|
||||||
function cdup() {
|
function cdup() {
|
||||||
@ -424,7 +424,7 @@ class ftp_base {
|
|||||||
}
|
}
|
||||||
if(!$this->_exec("SIZE ".$pathname, "filesize")) return FALSE;
|
if(!$this->_exec("SIZE ".$pathname, "filesize")) return FALSE;
|
||||||
if(!$this->_checkCode()) return FALSE;
|
if(!$this->_checkCode()) return FALSE;
|
||||||
return ereg_replace("^[0-9]{3} ([0-9]+)".CRLF, "\\1", $this->_message);
|
return preg_replace("/^[0-9]{3} ([0-9]+).*$/s", "\\1", $this->_message);
|
||||||
}
|
}
|
||||||
|
|
||||||
function abort() {
|
function abort() {
|
||||||
@ -444,7 +444,7 @@ class ftp_base {
|
|||||||
}
|
}
|
||||||
if(!$this->_exec("MDTM ".$pathname, "mdtm")) return FALSE;
|
if(!$this->_exec("MDTM ".$pathname, "mdtm")) return FALSE;
|
||||||
if(!$this->_checkCode()) return FALSE;
|
if(!$this->_checkCode()) return FALSE;
|
||||||
$mdtm = ereg_replace("^[0-9]{3} ([0-9]+)".CRLF, "\\1", $this->_message);
|
$mdtm = preg_replace("/^[0-9]{3} ([0-9]+).*$/", "\\1", $this->_message);
|
||||||
$date = sscanf($mdtm, "%4d%2d%2d%2d%2d%2d");
|
$date = sscanf($mdtm, "%4d%2d%2d%2d%2d%2d");
|
||||||
$timestamp = mktime($date[3], $date[4], $date[5], $date[1], $date[2], $date[0]);
|
$timestamp = mktime($date[3], $date[4], $date[5], $date[1], $date[2], $date[0]);
|
||||||
return $timestamp;
|
return $timestamp;
|
||||||
@ -818,8 +818,8 @@ class ftp_base {
|
|||||||
function glob_regexp($pattern,$probe) {
|
function glob_regexp($pattern,$probe) {
|
||||||
$sensitive=(PHP_OS!='WIN32');
|
$sensitive=(PHP_OS!='WIN32');
|
||||||
return ($sensitive?
|
return ($sensitive?
|
||||||
ereg($pattern,$probe):
|
preg_match( '/' . preg_quote( $pattern, '/' ) . '/', $probe ) :
|
||||||
eregi($pattern,$probe)
|
preg_match( '/' . preg_quote( $pattern, '/' ) . '/i', $probe )
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.4-alpha-34280';
|
$wp_version = '4.4-alpha-34281';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user