Opened 4 months ago
Last modified 3 months ago
#23428 new defect (bug)
comments_open causes PHP notice in certain cases
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Warnings/Notices | Version: | 2.5 |
| Severity: | normal | Keywords: | has-patch |
| Cc: |
Description
when comments_open() is called for a non-existant post (either a bad ID, or no ID passed and called from a non-single page), a PHP notice is caused. Ideally, plugins shouldn't be doing this, but a simple null check in comments_open() fixes the problem.
Attachments (1)
Change History (4)
willnorris — 4 months ago
comment:1
willnorris — 4 months ago
comment:2
SergeyBiryukov — 3 months ago
- Component changed from Comments to Warnings/Notices
- Version changed from trunk to 2.5
pings_open() has the similar code (introduced in [6716]):
http://core.trac.wordpress.org/browser/tags/3.5.1/wp-includes/comment-template.php#L789
Seems like the notice is appropriate in the case if a non-existent post, not sure if we should hide it. Related: ticket:17299:6.
comment:3
markoheijnen — 3 months ago
Maybe doing_it_wrong message?. A PHP notice isn't really telling something.
Note: See
TracTickets for help on using
tickets.

oh, and the PHP Notice that is triggered is: