﻿id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc
15002,unfiltered_html capability is not observed when set explicitly for role,phlux0r,,"When the unfiltered_html capability is explicitly set for a user role, WP does not observe it.

In wp-includes/capabilities.php around line 1021 the code is:
{{{
        case 'unfiltered_html':
                // Disallow unfiltered_html for all users, even admins and super admins.
                if ( defined('DISALLOW_UNFILTERED_HTML') && DISALLOW_UNFILTERED_HTML ) {
                        $caps[] = 'do_not_allow';
                        break;
                }
                // Fall through if not DISALLOW_UNFILTERED_HTML
}}}
My fix is to change it to:
{{{
        case 'unfiltered_html':
                // Disallow unfiltered_html for all users, even admins and super admins.
                if ( defined('DISALLOW_UNFILTERED_HTML') && DISALLOW_UNFILTERED_HTML ) {
                        $caps[] = 'do_not_allow';
                        break;
                } else { // FIX to observe the unfiltered_html capability assigned to role
                        $caps[] = $cap;
                        break;
                }
                // Fall through if not DISALLOW_UNFILTERED_HTML
}}}
Cheers, Robert",defect (bug),closed,normal,,Role/Capability,3.0.1,normal,invalid,reporter-feedback,lybica
