[wp-trac] Re: [WordPress Trac] #6907: A bug in /wp-admin/menu.php

WordPress Trac wp-trac at lists.automattic.com
Thu Nov 13 22:04:12 GMT 2008


#6907: A bug in /wp-admin/menu.php
--------------------------------+-------------------------------------------
 Reporter:  CrazySerb           |        Owner:  anonymous
     Type:  defect              |       Status:  new      
 Priority:  high                |    Milestone:  2.8      
Component:  General             |      Version:  2.5.1    
 Severity:  normal              |   Resolution:           
 Keywords:  menu.php has-patch  |  
--------------------------------+-------------------------------------------
Comment (by chelmer):

 The changes don't have to be too far-reaching. I had to make the
 modifications in our install so that 'moderate_comments' was used
 accurately in regard to comment moderation.

 The code currently ties comment moderation to 'edit_posts' (editors) or
 'edit_post' (with post ID passed for authors) capabilities rather than
 'moderate_comments'.

 Where 'edit_posts' (plural) is used in ''current_user_can()'' conditional
 statements, and comment moderation is in view, then 'moderate_comments'
 can safely replace it (this is only in /admin/menu.php). Where 'edit_post'
 (singular) is in the conditional statement, 'moderate_comments' must be
 added to the statements ( <code>if ( current_user_can('edit_post',
 $comment->comment_post_ID) )</code> to <code>if (
 current_user_can('edit_post', $comment->comment_post_ID) ||
 current_user_can('moderate_comments') )</code>.

 Changes were required in 16 places in 6 core files.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/6907#comment:7>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list