WordPress.org

Make WordPress Core

Changeset 13961


Ignore:
Timestamp:
04/03/10 08:08:12 (4 years ago)
Author:
nacin
Message:

Allow "No role for this blog" to be chosen on user-edit. Add defensive checks for a few potential notices. fixes #10833

Location:
trunk/wp-admin
Files:
2 edited

Legend:

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

    r13955 r13961  
    3131                // If the new role isn't editable by the logged-in user die with error 
    3232                $editable_roles = get_editable_roles(); 
    33                 if ( !$editable_roles[$new_role] ) 
     33                if ( empty( $editable_roles[$new_role] ) ) 
    3434                    wp_die(__('You can’t give users that role.')); 
    3535 
     
    8585        // If the new role isn't editable by the logged-in user die with error 
    8686        $editable_roles = get_editable_roles(); 
    87         if ( !$editable_roles[$new_role] ) 
     87        if ( ! empty( $new_role ) && empty( $editable_roles[$new_role] ) ) 
    8888            wp_die(__('You can’t give users that role.')); 
    8989    } 
  • trunk/wp-admin/users.php

    r13956 r13961  
    5858 
    5959    $editable_roles = get_editable_roles(); 
    60     if ( !$editable_roles[$_REQUEST['new_role']] ) 
     60    if ( empty( $editable_roles[$_REQUEST['new_role']] ) ) 
    6161        wp_die(__('You can’t give users that role.')); 
    6262 
Note: See TracChangeset for help on using the changeset viewer.