Bug with map_meta_cap filter
-
Hi, I’ve found some compatibility issues – there are cases where the security plugin wipes out admin menus and breaks capability checks.
In some cases the
map_meta_capfilter’s 2nd parameter$capevaluates to true, so because the following code in the Editors Service does not do a strict comparison the condition will pass:public function disable_file_edit( $caps, $cap ) { if ( in_array( $cap, array( 'edit_themes', 'edit_plugins', 'edit_files' ) ) ) { return array( 'sg-security' ); } return $caps; }The
in_array()function should use the 3rd argument astrueso it does a strict comparison rather than a loose one.Cheers!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Bug with map_meta_cap filter’ is closed to new replies.