Make WordPress Core


Ignore:
Timestamp:
02/10/2014 10:59:40 PM (11 years ago)
Author:
nacin
Message:

Detect and handle symlinking of plugins in plugin_basename().

props rmccue, MikeSchinkel, jdgrimes.
see #16953.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/functions.php

    r27154 r27158  
    14321432
    14331433    return rtrim($base, '/') . '/' . ltrim($path, '/');
     1434}
     1435
     1436/**
     1437 * Normalize a filesystem path.
     1438 *
     1439 * Replaces backslashes with forward slashes for Windows systems,
     1440 * and ensures no duplicate slashes exist.
     1441 *
     1442 * @since 3.9.0
     1443 *
     1444 * @param string $path Path to normalize.
     1445 * @return string Normalized path.
     1446 */
     1447function wp_normalize_path( $path ) {
     1448    $path = str_replace( '\\', '/', $path );
     1449    $path = preg_replace( '|/+|','/', $path );
     1450    return $path;
    14341451}
    14351452
Note: See TracChangeset for help on using the changeset viewer.