mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-09 11:40:04 +00:00
Updates: FTP/PemFTP Library: Remove the usage of deprecated regular expression functions (ereg replaced by PCRE).
Props enshrined, aaroncampbell Fixes #16026, #33432 git-svn-id: https://develop.svn.wordpress.org/trunk@34281 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -380,7 +380,7 @@ class ftp_base {
|
||||
function pwd() {
|
||||
if(!$this->_exec("PWD", "pwd")) 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() {
|
||||
@@ -424,7 +424,7 @@ class ftp_base {
|
||||
}
|
||||
if(!$this->_exec("SIZE ".$pathname, "filesize")) 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() {
|
||||
@@ -444,7 +444,7 @@ class ftp_base {
|
||||
}
|
||||
if(!$this->_exec("MDTM ".$pathname, "mdtm")) 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");
|
||||
$timestamp = mktime($date[3], $date[4], $date[5], $date[1], $date[2], $date[0]);
|
||||
return $timestamp;
|
||||
@@ -818,8 +818,8 @@ class ftp_base {
|
||||
function glob_regexp($pattern,$probe) {
|
||||
$sensitive=(PHP_OS!='WIN32');
|
||||
return ($sensitive?
|
||||
ereg($pattern,$probe):
|
||||
eregi($pattern,$probe)
|
||||
preg_match( '/' . preg_quote( $pattern, '/' ) . '/', $probe ) :
|
||||
preg_match( '/' . preg_quote( $pattern, '/' ) . '/i', $probe )
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user