Opened 12 years ago
Closed 9 years ago
#23746 closed defect (bug) (fixed)
add_role require string does not check for empty string
Reported by: | Kenshino | Owned by: | chriscct7 |
---|---|---|---|
Milestone: | 4.4 | Priority: | normal |
Severity: | normal | Version: | 3.5 |
Component: | Role/Capability | Keywords: | has-patch |
Focuses: | Cc: |
Description (last modified by )
<?php add_role( $role, $display_name, $capabilities ); ?>
add_role works with $role as ''
.
Perhaps it should check for empty string before allowing it to be added?
Attachments (3)
Change History (11)
#3
@
12 years ago
- Cc michielhab added
Added check on $role in function add_role. If empty then return. 23746.diff
#5
@
11 years ago
I've made a little change in the patch of Michiel. In his patch in the file wp-includes/capabilities.php:164 the script is checking if $this->roles[$role] isset. After that the script is checking if $role isset. I've switched those 2 if's.
Note: See
TracTickets for help on using
tickets.
Couldn't put single quotes