mirror of
git://develop.git.wordpress.org/
synced 2025-01-17 12:58:25 +01:00
FTP/PemFTP Library: Fix some PHP notices.
- `ftp_base::glob()` used `each()`, which is deprecated as of PHP 7.2. - `ftp_base::fget()` was missing the decleration of its third parameter, `$rest`. Props itowhid06. See #44489. git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43848 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
f05a39a875
commit
6ca255f3fd
@ -524,7 +524,7 @@ class ftp_base {
|
||||
return $exists;
|
||||
}
|
||||
|
||||
function fget($fp, $remotefile,$rest=0) {
|
||||
function fget($fp, $remotefile, $rest=0) {
|
||||
if($this->_can_restore and $rest!=0) fseek($fp, $rest);
|
||||
$pi=pathinfo($remotefile);
|
||||
if($this->_type==FTP_ASCII or ($this->_type==FTP_AUTOASCII and in_array(strtoupper($pi["extension"]), $this->AutoAsciiExt))) $mode=FTP_ASCII;
|
||||
@ -583,7 +583,7 @@ class ftp_base {
|
||||
return $out;
|
||||
}
|
||||
|
||||
function fput($remotefile, $fp) {
|
||||
function fput($remotefile, $fp, $rest=0) {
|
||||
if($this->_can_restore and $rest!=0) fseek($fp, $rest);
|
||||
$pi=pathinfo($remotefile);
|
||||
if($this->_type==FTP_ASCII or ($this->_type==FTP_AUTOASCII and in_array(strtoupper($pi["extension"]), $this->AutoAsciiExt))) $mode=FTP_ASCII;
|
||||
@ -775,7 +775,7 @@ class ftp_base {
|
||||
$pattern=substr($pattern,$lastpos);
|
||||
} else $path=getcwd();
|
||||
if(is_array($handle) and !empty($handle)) {
|
||||
while($dir=each($handle)) {
|
||||
foreach($handle as $dir) {
|
||||
if($this->glob_pattern_match($pattern,$dir))
|
||||
$output[]=$dir;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user