Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#35473 closed defect (bug) (wontfix)

Remove unused local variable in function comments_template()

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

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 11 years ago.

Download all attachments as: .zip

Change History (9)

#1 @swissspidy
11 years ago

  • Keywords needs-patch added

#2 @Latz
11 years ago

  • Keywords has-patch added; needs-patch removed

#3 @swissspidy
11 years ago

  • Keywords commit added
  • Milestone Awaiting Review → 4.5

#4 @swissspidy
11 years ago

  • Owner set to swissspidy
  • Resolution → fixed
  • Status new → closed

In 36322:

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

Props Latz.
Fixes #35473.

#5 follow-up: @SergeyBiryukov
11 years ago

  • Keywords revert added; has-patch commit removed
  • Resolution fixed
  • Status closed → 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
11 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
11 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
11 years ago

  • Milestone 4.5
  • Resolution → wontfix
  • Status reopened → closed
Note: See TracTickets for help on using tickets.