Make WordPress Core


Ignore:
Timestamp:
04/08/2009 06:34:46 PM (17 years ago)
Author:
ryan
Message:

Require active plugin files to end in .php. Props hakre. fixes #9406

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-settings.php

    r10810 r10892  
    513513}
    514514
    515 if ( get_option('active_plugins') && !defined('WP_INSTALLING') ) {
    516     $current_plugins = get_option('active_plugins');
    517     if ( is_array($current_plugins) ) {
    518         foreach ( $current_plugins as $plugin ) {
    519             if ( '' != $plugin && 0 == validate_file($plugin) && file_exists(WP_PLUGIN_DIR . '/' . $plugin) )
    520                 include_once(WP_PLUGIN_DIR . '/' . $plugin);
    521         }
    522         unset($plugin);
     515$current_plugins = get_option('active_plugins');
     516if ( is_array($current_plugins) && !defined('WP_INSTALLING') ) {
     517    foreach ( $current_plugins as $plugin ) {
     518        // check the $plugin filename
     519        // Validate plugin filename
     520        if ( validate_file($plugin) // $plugin must validate as file
     521            || '.php' != substr($plugin, -4) // $plugin must end with '.php'
     522            || !file_exists(WP_PLUGIN_DIR . '/' . $plugin)  // $plugin must exist
     523            )
     524            continue;
     525
     526        include_once(WP_PLUGIN_DIR . '/' . $plugin);
    523527    }
    524 }
     528    unset($plugin);
     529}
     530unset($current_plugins);
    525531
    526532require (ABSPATH . WPINC . '/pluggable.php');
Note: See TracChangeset for help on using the changeset viewer.