WordPress.org

Make WordPress Core

Ticket #7878: 7878.2.diff

File 7878.2.diff, 743 bytes (added by DD32, 10 years ago)

patch refresh without extra changes

  • wp-admin/includes/plugin.php

     
    215259 */
    216260function activate_plugin($plugin, $redirect = '') {
    217261        $current = get_option('active_plugins');
    218         $plugin = trim($plugin);
     262        $plugin = plugin_basename(trim($plugin));
    219263
    220264        $valid = validate_plugin($plugin);
    221265        if ( is_wp_error($valid) )
     
    254298                $plugins = array($plugins);
    255299
    256300        foreach ( $plugins as $plugin ) {
     301                $plugin = plugin_basename($plugin);
    257302                if( ! is_plugin_active($plugin) )
    258303                        continue;
    259304                array_splice($current, array_search( $plugin, $current), 1 ); // Fixed Array-fu!