Make WordPress Core

Ticket #43417: 43417.diff

File 43417.diff, 626 bytes (added by soulseekah, 6 years ago)

Initial fix attempt

  • src/wp-includes/functions.php

    diff --git src/wp-includes/functions.php src/wp-includes/functions.php
    index 53a2204..ed4a6fa 100644
    function wp_mkdir_p( $target ) { 
    16801680        // We need to find the permissions of the parent folder that exists and inherit that.
    16811681        $target_parent = dirname( $target );
    16821682        while ( '.' != $target_parent && ! is_dir( $target_parent ) ) {
     1683                // Infinite loop protection (see https://core.trac.wordpress.org/ticket/43417)
     1684                if ( dirname( $target_parent ) === $target_parent ) {
     1685                        break;
     1686                }
    16831687                $target_parent = dirname( $target_parent );
    16841688        }
    16851689