Opened 13 years ago
Closed 11 years ago
#23746 closed defect (bug) (fixed)
add_role require string does not check for empty string
| Reported by: | Kenshino | Owned by: | chriscct7 |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.4 |
| Component: | Role/Capability | Version: | 3.5 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
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
@
13 years ago
- Cc added
Added check on $role in function add_role. If empty then return. 23746.diff
#5
@
13 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Couldn't put single quotes