Make WordPress Core


Ignore:
Timestamp:
12/14/2018 12:25:16 PM (6 years ago)
Author:
atimmer
Message:

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, pento.
Merges [43848] to trunk.
Fixes #44489.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/wp-admin/includes/class-ftp.php

    r38470 r44184  
    525525    }
    526526
    527     function fget($fp, $remotefile,$rest=0) {
     527    function fget($fp, $remotefile, $rest=0) {
    528528        if($this->_can_restore and $rest!=0) fseek($fp, $rest);
    529529        $pi=pathinfo($remotefile);
     
    584584    }
    585585
    586     function fput($remotefile, $fp) {
     586    function fput($remotefile, $fp, $rest=0) {
    587587        if($this->_can_restore and $rest!=0) fseek($fp, $rest);
    588588        $pi=pathinfo($remotefile);
     
    776776        } else $path=getcwd();
    777777        if(is_array($handle) and !empty($handle)) {
    778             while($dir=each($handle)) {
     778            foreach($handle as $dir) {
    779779                if($this->glob_pattern_match($pattern,$dir))
    780780                $output[]=$dir;
Note: See TracChangeset for help on using the changeset viewer.