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:
dd32 2010-01-17 02:44:47 +00:00
parent e85a09e8e9
commit f1bc3dde7b
1 changed files with 6 additions and 0 deletions

View File

@ -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 );