Make WordPress Core

Changeset 42804


Ignore:
Timestamp:
03/08/2018 07:44:10 PM (9 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.
Merges [42801] to the 4.9 branch.
Fixes #43417.

Location:
branches/4.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.9

  • branches/4.9/src/wp-includes/functions.php

    r42571 r42804  
    16161616        // We need to find the permissions of the parent folder that exists and inherit that.
    16171617        $target_parent = dirname( $target );
    1618         while ( '.' != $target_parent && ! is_dir( $target_parent ) ) {
     1618        while ( '.' != $target_parent && ! is_dir( $target_parent ) && dirname( $target_parent ) !== $target_parent ) {
    16191619                $target_parent = dirname( $target_parent );
    16201620        }
Note: See TracChangeset for help on using the changeset viewer.