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. git-svn-id: https://develop.svn.wordpress.org/trunk@42801 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
f6de9b77f8
commit
19ed786c78
|
@ -1679,7 +1679,7 @@ function wp_mkdir_p( $target ) {
|
|||
|
||||
// We need to find the permissions of the parent folder that exists and inherit that.
|
||||
$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 );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue