Ticket #1774 (closed defect (bug): fixed)

Opened 3 years ago

Last modified 2 years ago

removing redundant line in source:trunk/wp-admin/edit-comments.php#2832

Reported by: johnjosephbachir Assigned to: markjaquith
Priority: low Milestone:
Component: Optimization Version: 1.6
Severity: minor Keywords: bg|has-patch bg|commit bg|squashed
Cc:

Description

Unless my tired eyes are missing something obvious, i think this extra permissions check is completely redundant (maybe there used to be a discrepency between the two cases?).

diff for source:trunk/wp-admin/edit-comments.php :

Index: edit-comments.php
===================================================================
--- edit-comments.php	(revision 2955)
+++ edit-comments.php	(working copy)
@@ -95,8 +95,6 @@
         <p><?php _e('Posted'); echo ' '; comment_date('M j, g:i A');  
 			if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
 				echo " | <a href=\"post.php?action=editcomment&amp;comment=".$comment->comment_ID."\">" . __('Edit Comment') . "</a>";
-			}
-			if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
 				echo " | <a href=\"post.php?action=deletecomment&amp;p=".$comment->comment_post_ID."&amp;comment=".$comment->comment_ID."\" onclick=\"return deleteSomething( 'comment', $comment->comment_ID, '" . sprintf(__("You are about to delete this comment by &quot;%s&quot;.\\n&quot;Cancel&quot; to stop, &quot;OK&quot; to delete."), wp_specialchars( $comment->comment_author, 1 ))  . "' );\">" . __('Delete Comment') . "</a> &#8212; ";
 			} // end if any comments to show
 			// Get post title

Attachments

edit-comments.php.diff (1.0 kB) - added by johnjosephbachir on 10/19/05 04:58:30.
diff for source:trunk/wp-admin/edit-comments.php#2832

Change History

10/19/05 04:58:30 changed by johnjosephbachir

  • attachment edit-comments.php.diff added.

10/19/05 04:59:34 changed by johnjosephbachir

  • summary changed from removing redundant line in source:trunk/wp-admin/edit-comments.php to removing redundant line in source:trunk/wp-admin/edit-comments.php#2832.

10/21/05 03:50:58 changed by markjaquith

  • keywords set to bg|has-patch bg|commit.
  • owner changed from anonymous to markjaquith.
  • status changed from new to assigned.

Nah, that wouldn't have changed after the first echo. Nice catch.

11/05/05 21:06:07 changed by skippy

  • keywords changed from bg|has-patch bg|commit to bg|has-patch bg|commit bg|squashed.

11/11/05 00:32:16 changed by ryan

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [3036]) Remove redundant lines. Props johnjosephbachir. fixes #1774

11/30/06 19:41:47 changed by

  • milestone deleted.

Milestone 2.0 deleted