Make WordPress Core

Changeset 21197


Ignore:
Timestamp:
06/30/2012 12:19:13 PM (12 years ago)
Author:
nacin
Message:

Cap checks for links in the upgrader, for plugins. fixes #19824.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/class-wp-upgrader.php

    r21195 r21197  
    11961196            'plugins_page' => '<a href="' . self_admin_url('plugins.php') . '" title="' . esc_attr__('Go to plugins page') . '" target="_parent">' . __('Return to Plugins page') . '</a>'
    11971197        );
    1198         if ( $this->plugin_active )
    1199             unset( $update_actions['activate_plugin'] );
    1200         if ( ! $this->result || is_wp_error($this->result) )
     1198        if ( $this->plugin_active || ! $this->result || is_wp_error( $this->result ) || ! current_user_can( 'activate_plugins' ) )
    12011199            unset( $update_actions['activate_plugin'] );
    12021200
     
    14501448
    14511449        if ( ! $this->result || is_wp_error($this->result) ) {
     1450            unset( $install_actions['activate_plugin'], $install_actions['network_activate'] );
     1451        } elseif ( ! current_user_can( 'activate_plugins' ) ) {
    14521452            unset( $install_actions['activate_plugin'] );
    1453             unset( $install_actions['network_activate'] );
    1454         }
     1453        }
     1454
    14551455        $install_actions = apply_filters('install_plugin_complete_actions', $install_actions, $this->api, $plugin_file);
    14561456        if ( ! empty($install_actions) )
Note: See TracChangeset for help on using the changeset viewer.