Changeset 22094 for trunk/wp-includes/functions.php
- Timestamp:
- 10/01/2012 08:59:06 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r22082 r22094 1296 1296 */ 1297 1297 function wp_mkdir_p( $target ) { 1298 $wrapper = null; 1299 1300 // strip the protocol 1301 if( wp_is_stream( $target ) ) { 1302 list( $wrapper, $target ) = explode( '://', $target, 2 ); 1303 } 1304 1298 1305 // from php.net/mkdir user contributed notes 1299 1306 $target = str_replace( '//', '/', $target ); 1307 1308 // put the wrapper back on the target 1309 if( $wrapper !== null ) { 1310 $target = $wrapper . '://' . $target; 1311 } 1300 1312 1301 1313 // safe mode fails with a trailing slash under certain PHP versions. … … 3751 3763 3752 3764 /** 3765 * Test if a given path is a stream URL 3766 * 3767 * @param string $path The resource path or URL 3768 * @return bool True if the path is a stream URL 3769 */ 3770 function wp_is_stream( $path ) { 3771 $wrappers = stream_get_wrappers(); 3772 $wrappers_re = '(' . join('|', $wrappers) . ')'; 3773 3774 return preg_match( "!^$wrappers_re://!", $path ) === 1; 3775 } 3776 3777 /** 3753 3778 * Test if the supplied date is valid for the Gregorian calendar 3754 3779 *
Note: See TracChangeset
for help on using the changeset viewer.