Unpublished Pages Can Sometimes Be Viewed

Description

Pages which have been published and then set back to unpublished can still be viewed on the site by the author, while other users will see the 404 page.

Publish a page

Note the author and guests can see the page on the site.

Change the status to unpublished.

Note the author can still see the page on the site

Note that a guest cannot see the page on the site and gets a 404.

Note: In some cases the guest may forego the 404 page and be sent to a wholly different post which has a similar permalink. (The 404 is still posted, the guest just never sees it.) I still haven't been able to reproduce this reliably though.

A post which has never been published is viewable as a preview to the author, but attempting to view that post via the slug will return a 404 error. If that post is published and then changed to unpublished, it will be viewable via the slug (by the author only). This inconsistency seems to be a bug.