WordPress.org

Make WordPress Core

Changeset 35945


Ignore:
Timestamp:
12/15/2015 02:36:59 AM (4 years ago)
Author:
dd32
Message:

Filesystem: Revert [33648] and [34733] unfortunately these have caused issues for some servers, while fixing it for others.

See #28013
Fixes #34976 for the 4.4 branch
Fixes #34976 for the 4.4 branch

Location:
branches/4.4
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/4.4

  • branches/4.4/src/wp-admin/includes/class-wp-filesystem-ftpext.php

    r35663 r35945  
    327327     * @return bool
    328328     */
    329     public function exists( $file ) {
    330         $path = dirname( $file );
    331         $filename = basename( $file );
    332 
    333         $file_list = @ftp_nlist( $this->link, '-a ' . $path );
    334         if ( $file_list ) {
    335             $file_list = array_map( 'basename', $file_list );
    336         }
    337 
    338         return $file_list && in_array( $filename, $file_list );
     329    public function exists($file) {
     330        $list = @ftp_nlist($this->link, $file);
     331
     332        if ( empty( $list ) && $this->is_dir( $file ) ) {
     333            return true; // File is an empty directory.
     334        }
     335
     336        return !empty($list); //empty list = no file, so invert.
    339337    }
    340338
  • branches/4.4/src/wp-admin/includes/class-wp-filesystem-ftpsockets.php

    r35664 r35945  
    343343     */
    344344    public function exists( $file ) {
    345         $list = $this->ftp->rawlist( $file, '-a' );
     345        $list = $this->ftp->nlist( $file );
    346346
    347347        if ( empty( $list ) && $this->is_dir( $file ) ) {
Note: See TracChangeset for help on using the changeset viewer.