[wp-trac] [WordPress Trac] #59866: Attachment pages are only disabled for users that are logged in

WordPress Trac noreply at wordpress.org
Thu Nov 9 13:52:55 UTC 2023


#59866: Attachment pages are only disabled for users that are logged in
-------------------------------------+---------------------
 Reporter:  joppuyo                  |       Owner:  (none)
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  6.4.2
Component:  Media                    |     Version:  6.4
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:
-------------------------------------+---------------------

Comment (by chesio):

 I concur, the original patch does not solve the problem - there is still
 no redirect for anonymous users due to the `read_post` capability check.

 I propose a slightly different solution (see 59866-cp.diff):
 1. Attachments not attached to any post cannot be private, so they should
 be always redirected.
 2. Attachments attached to a post should use existing check for private
 status. This check is triggered when `$redirect_obj` is set. See:
 https://core.trac.wordpress.org/browser/trunk/src/wp-
 includes/canonical.php#L776

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/59866#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list