Fix wp_mkdir_p() when running under safe_mode on certain PHP versions. Props Denis-de-Bernardy. Fixes #8830
git-svn-id: http://svn.automattic.com/wordpress/trunk@12740 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
e85a09e8e9
commit
f1bc3dde7b
|
@ -1933,6 +1933,12 @@ function wp_get_original_referer() {
|
|||
function wp_mkdir_p( $target ) {
|
||||
// from php.net/mkdir user contributed notes
|
||||
$target = str_replace( '//', '/', $target );
|
||||
|
||||
// safe mode fails with trailing slash under certain PHP versions.
|
||||
$target = untrailingslashit($target);
|
||||
if ( empty($target) )
|
||||
$target = '/';
|
||||
|
||||
if ( file_exists( $target ) )
|
||||
return @is_dir( $target );
|
||||
|
||||
|
|
Loading…
Reference in New Issue