Make WordPress Core

Changeset 21223


Ignore:
Timestamp:
07/06/2012 11:39:39 AM (12 years ago)
Author:
dd32
Message:

WP_Filesystem: Return symlinked directory names correctly, previously the FTP extensions would return it as 'source -> dest' instead of simply 'source'. Props kurtpayne. Fixes #17846

Location:
trunk/wp-admin/includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/class-wp-filesystem-ftpext.php

    r19712 r21223  
    331331        }
    332332
     333        // Replace symlinks formatted as "source -> target" with just the source name
     334        if ( $b['islink'] )
     335            $b['name'] = preg_replace( '/(\s*->\s*.*)$/', '', $b['name'] );
     336
    333337        return $b;
    334338    }
  • trunk/wp-admin/includes/class-wp-filesystem-ftpsockets.php

    r19712 r21223  
    319319            }
    320320
     321            // Replace symlinks formatted as "source -> target" with just the source name
     322            if ( $struc['islink'] )
     323                $struc['name'] = preg_replace( '/(\s*->\s*.*)$/', '', $struc['name'] );
     324
    321325            $ret[ $struc['name'] ] = $struc;
    322326        }
Note: See TracChangeset for help on using the changeset viewer.