Make WordPress Core


Ignore:
Timestamp:
12/03/2009 01:43:49 AM (16 years ago)
Author:
azaozz
Message:

Fix errors when bulk actions executed on empty list, props nacin, see #11184

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/plugins.php

    r12231 r12317  
    6565            check_admin_referer('bulk-manage-plugins');
    6666
    67             $plugins = (array) $_POST['checked'];
     67            $plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
    6868            $plugins = array_filter($plugins, create_function('$plugin', 'return !is_plugin_active($plugin);') ); //Only activate plugins which are not already active.
    6969            if ( empty($plugins) ) {
     
    116116            check_admin_referer('bulk-manage-plugins');
    117117
    118             $plugins = (array) $_POST['checked'];
     118            $plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
    119119            $plugins = array_filter($plugins, 'is_plugin_active'); //Do not deactivate plugins which are already deactivated.
    120120            if ( empty($plugins) ) {
     
    139139            check_admin_referer('bulk-manage-plugins');
    140140
    141             $plugins = (array) $_REQUEST['checked']; //$_POST = from the plugin form; $_GET = from the FTP details screen.
     141            //$_POST = from the plugin form; $_GET = from the FTP details screen.
     142            $plugins = isset( $_REQUEST['checked'] ) ? (array) $_REQUEST['checked'] : array();
    142143            $plugins = array_filter($plugins, create_function('$plugin', 'return !is_plugin_active($plugin);') ); //Do not allow to delete Activated plugins.
    143144            if ( empty($plugins) ) {
Note: See TracChangeset for help on using the changeset viewer.