WordPress.org

Make WordPress Core

Changeset 5928


Ignore:
Timestamp:
08/23/2007 06:11:44 PM (12 years ago)
Author:
westi
Message:

Fix plugin basename for Windows servers. Fixes #3002 for 2.2.x props Ozh

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/wp-includes/plugin.php

    r5412 r5928  
    236236 */
    237237function plugin_basename($file) {
    238     $file = preg_replace('|\\\\+|', '\\\\', $file);
    239     $file = preg_replace('/^.*wp-content[\\\\\/]plugins[\\\\\/]/', '', $file);
     238    $file = str_replace('\\','/',$file); // sanitize for Win32 installs
     239    $file = preg_replace('|/+|','/', $file); // remove any duplicate slash
     240    $file = preg_replace('|^.*/wp-content/plugins/|','',$file); // get relative path from plugins dir
    240241    return $file;
    241242}
Note: See TracChangeset for help on using the changeset viewer.