Fix WP_Filesystem_Direct::mkdir() when running under safe_mode on certain versions of PHP. Props remi. Fixes #10497
git-svn-id: http://svn.automattic.com/wordpress/trunk@12741 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
f1bc3dde7b
commit
fc2c5fd21b
|
@ -279,6 +279,11 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
|
|||
}
|
||||
|
||||
function mkdir($path, $chmod = false, $chown = false, $chgrp = false) {
|
||||
// safe mode fails with a trailing slash under certain PHP versions.
|
||||
$path = untrailingslashit($path);
|
||||
if ( empty($path) )
|
||||
$path = '/';
|
||||
|
||||
if ( ! $chmod )
|
||||
$chmod = FS_CHMOD_DIR;
|
||||
|
||||
|
|
|
@ -1934,7 +1934,7 @@ 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.
|
||||
// safe mode fails with a trailing slash under certain PHP versions.
|
||||
$target = untrailingslashit($target);
|
||||
if ( empty($target) )
|
||||
$target = '/';
|
||||
|
|
Loading…
Reference in New Issue