Make WordPress Core


Ignore:
Timestamp:
03/08/2018 07:31:59 PM (7 years ago)
Author:
SergeyBiryukov
Message:

Filesystem API: Avoid an infinite loop in wp_mkdir_p() when trying to determine the parent folder with open_basedir restriction in effect.

Props soulseekah, 1265578519-1.
Fixes #43417.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/functions.php

    r42800 r42801  
    16801680    // We need to find the permissions of the parent folder that exists and inherit that.
    16811681    $target_parent = dirname( $target );
    1682     while ( '.' != $target_parent && ! is_dir( $target_parent ) ) {
     1682    while ( '.' != $target_parent && ! is_dir( $target_parent ) && dirname( $target_parent ) !== $target_parent ) {
    16831683        $target_parent = dirname( $target_parent );
    16841684    }
Note: See TracChangeset for help on using the changeset viewer.