mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-04 04:34:31 +00:00
Detect and handle symlinking of plugins in plugin_basename().
props rmccue, MikeSchinkel, jdgrimes. see #16953. git-svn-id: https://develop.svn.wordpress.org/trunk@27158 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1433,6 +1433,23 @@ function path_join( $base, $path ) {
|
||||
return rtrim($base, '/') . '/' . ltrim($path, '/');
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalize a filesystem path.
|
||||
*
|
||||
* Replaces backslashes with forward slashes for Windows systems,
|
||||
* and ensures no duplicate slashes exist.
|
||||
*
|
||||
* @since 3.9.0
|
||||
*
|
||||
* @param string $path Path to normalize.
|
||||
* @return string Normalized path.
|
||||
*/
|
||||
function wp_normalize_path( $path ) {
|
||||
$path = str_replace( '\\', '/', $path );
|
||||
$path = preg_replace( '|/+|','/', $path );
|
||||
return $path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines a writable directory for temporary files.
|
||||
* Function's preference is the return value of <code>sys_get_temp_dir()</code>,
|
||||
|
||||
Reference in New Issue
Block a user