Opened 2 years ago
Closed 2 years ago
#16506 closed defect (bug) (fixed)
Links to private posts in the Recent Comments widget return 404 for logged out users
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | high | Milestone: | 3.2 |
| Component: | Widgets | Version: | 3.0 |
| Severity: | normal | Keywords: | has-patch 3.2-early |
| Cc: | sheri@… |
Description
Expected: links shown in the recent comments widget to work for logged out users.
Observed: links to private posts return 404 for logged out users.
To reproduce:
- Open a WordPress blog
- Go to Appearance -> Widgets and add the Recent Comments widget
- Create two posts and publish them: one private, one password-protected
- Leave comments on each post
- Go to Comments and make sure the new comments are approved
- Clear cache and cookies or use an incognito window to view the blog
- Result: Comments for both the password protected and the private post are visible in the Recent Comments widget. Clicking on the comment for the private post results in a 404 error. Clicking on the comment for the password-protected post results in asking for a password.
Tested in WPCOM latest and WPORG [17426].
I think it makes sense to leave comments for password-protected posts in the Recent Comments widget, but removing comments of private posts for users without rights to see them makes sense since they return a 404 otherwise.
Attachments (2)
Change History (11)
comment:1
designsimply — 2 years ago
- Cc sheri@… added
- Priority changed from normal to high
- Severity changed from normal to major
- Version set to 3.0
- Keywords has-patch added; needs-patch removed
Was pretty simple to replicate r12333 in get_comments().
- Keywords 3.2-early added
- Milestone changed from Awaiting Review to Future Release
- Severity changed from major to normal
Fixed initially in 2.9. Broken come 3.0. Too late for 3.1.
May as well throw a few other fields in there.
Also, should something be done to filter out password-protected posts?

Confirmed as a regression from 2.9 to 3.0. Original fix: r12333.
Broken when we went to get_comments().