Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#35473 closed defect (bug) (wontfix)

Remove unused local variable in function comments_template()

Reported by: latz's profile Latz Owned by: swissspidy's profile swissspidy
Milestone: Priority: normal
Severity: normal Version: 2.2
Component: Comments Keywords: revert
Focuses: Cc:

Description

The local variable $req is not used anywhere else in the function "comments_template()" (wp-includes/comment-template.php).

Attachments (1)

35473.diff (410 bytes) - added by Latz 9 years ago.

Download all attachments as: .zip

Change History (9)

#1 @swissspidy
9 years ago

  • Keywords needs-patch added

@Latz
9 years ago

#2 @Latz
9 years ago

  • Keywords has-patch added; needs-patch removed

#3 @swissspidy
9 years ago

  • Keywords commit added
  • Milestone changed from Awaiting Review to 4.5

#4 @swissspidy
9 years ago

  • Owner set to swissspidy
  • Resolution set to fixed
  • Status changed from new to closed

In 36322:

Comments: Remove unneeded $req variable in comments_template().

Props Latz.
Fixes #35473.

#5 follow-up: @SergeyBiryukov
9 years ago

  • Keywords revert added; has-patch commit removed
  • Resolution fixed deleted
  • Status changed from closed to reopened

$req was used in Kubrick's comments.php template and is still used in theme-compat/comments.php.

We should keep it for back compat.

#6 in reply to: ↑ 5 @Latz
9 years ago

Replying to SergeyBiryukov:

We should keep it for back compat.

I agree. I wasn't aware of this behaviour. Next time I try to clean up some old code I will take more care of side effects.

#7 @rachelbaker
9 years ago

In 36425:

Comments: Add back $req variable in comments_template().

The variables in comments_template() should never be assumed to be unused. This function includes the comments.php template file from the active theme or falls back to theme-compat/comments.php. This is why including a file within a function only brings pain and sorrow.

Reverts r36322.

See #35473.

#8 @rachelbaker
9 years ago

  • Milestone 4.5 deleted
  • Resolution set to wontfix
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.