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. Built from https://develop.svn.wordpress.org/branches/4.9@42804 git-svn-id: http://core.svn.wordpress.org/branches/4.9@42634 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
7f190a310c
commit
08aa0f52f9
|
@ -1615,7 +1615,7 @@ function wp_mkdir_p( $target ) {
|
||||||
|
|
||||||
// We need to find the permissions of the parent folder that exists and inherit that.
|
// We need to find the permissions of the parent folder that exists and inherit that.
|
||||||
$target_parent = dirname( $target );
|
$target_parent = dirname( $target );
|
||||||
while ( '.' != $target_parent && ! is_dir( $target_parent ) ) {
|
while ( '.' != $target_parent && ! is_dir( $target_parent ) && dirname( $target_parent ) !== $target_parent ) {
|
||||||
$target_parent = dirname( $target_parent );
|
$target_parent = dirname( $target_parent );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.9.5-alpha-42803';
|
$wp_version = '4.9.5-alpha-42804';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue