WordPress.org

Make WordPress Core

Changeset 18964


Ignore:
Timestamp:
10/13/2011 10:43:38 AM (8 years ago)
Author:
dd32
Message:

WP_Filesystem_*::mkdir() untrailingslash path consistently, don't waste time attempting to create an "empty" path. See #15575. Props lordandrei and SergeyBiryukov for initial patches.

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

Legend:

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

    r18632 r18964  
    288288        $path = untrailingslashit($path);
    289289        if ( empty($path) )
    290             $path = '/';
     290            return false;
    291291
    292292        if ( ! $chmod )
  • trunk/wp-admin/includes/class-wp-filesystem-ftpext.php

    r18632 r18964  
    248248    }
    249249    function mkdir($path, $chmod = false, $chown = false, $chgrp = false) {
     250        $path = untrailingslashit($path);
     251        if ( empty($path) )
     252            return false;
     253
    250254        if ( !@ftp_mkdir($this->link, $path) )
    251255            return false;
  • trunk/wp-admin/includes/class-wp-filesystem-ftpsockets.php

    r17771 r18964  
    268268
    269269    function mkdir($path, $chmod = false, $chown = false, $chgrp = false ) {
     270        $path = untrailingslashit($path);
     271        if ( empty($path) )
     272            return false;
     273
    270274        if ( ! $this->ftp->mkdir($path) )
    271275            return false;
  • trunk/wp-admin/includes/class-wp-filesystem-ssh2.php

    r18632 r18964  
    312312    function mkdir($path, $chmod = false, $chown = false, $chgrp = false) {
    313313        $path = untrailingslashit($path);
     314        if ( empty($path) )
     315            return false;
     316
    314317        if ( ! $chmod )
    315318            $chmod = FS_CHMOD_DIR;
Note: See TracChangeset for help on using the changeset viewer.