Ticket #18543: wp_mkdir_p.2.diff
File wp_mkdir_p.2.diff, 895 bytes (added by , 13 years ago) |
---|
-
wp-includes/functions.php
2076 2076 * @return bool Whether the path was created. True if path already exists. 2077 2077 */ 2078 2078 function wp_mkdir_p( $target ) { 2079 $wrapper = null; 2080 2081 // strip the protocol 2082 if( wp_is_stream($target) ) { 2083 list( $wrapper, $target ) = explode( '://', $target, 2 ); 2084 } 2085 2079 2086 // from php.net/mkdir user contributed notes 2080 2087 $target = str_replace( '//', '/', $target ); 2081 2088 2089 // put the wrapper back on the target 2090 if( $wrapper !== null ) { 2091 $target = $wrapper . '://' . $target; 2092 } 2093 2082 2094 // safe mode fails with a trailing slash under certain PHP versions. 2083 2095 $target = rtrim($target, '/'); // Use rtrim() instead of untrailingslashit to avoid formatting.php dependency. 2084 2096 if ( empty($target) )