Make WordPress Core

Changeset 5924


Ignore:
Timestamp:
08/23/2007 04:07:21 PM (17 years ago)
Author:
westi
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/plugin.php

    r5857 r5924  
    238238 */
    239239function plugin_basename($file) {
    240     $file = preg_replace('|\\\\+|', '\\\\', $file);
    241     $file = preg_replace('/^.*wp-content[\\\\\/]plugins[\\\\\/]/', '', $file);
     240    $file = str_replace('\\','/',$file); // sanitize for Win32 installs
     241    $file = preg_replace('|/+|','/', $file); // remove any duplicate slash
     242    $file = preg_replace('|^.*/wp-content/plugins/|','',$file); // get relative path from plugins dir
    242243    return $file;
    243244}
Note: See TracChangeset for help on using the changeset viewer.