wordpress-develop/tests/phpunit/tests/canonical
Peter Wilson 553d618e4a Canonical: Prevent ID enumeration of private post slugs.
Add check to `redirect_canonical()` to ensure private posts only redirect for logged in users.

Modifies the `read_post` mata capability to user `get_post_status()` rather than the post's `post_status` property to allow attachments to redirect based on the inherited post status.

Introduces `wp_force_ugly_post_permalink()` to unify the check to determine if an ugly link should be displayed in each of the functions used for determining permalinks: `get_permalink()`, `get_post_permalink()`, `_get_page_link()` and `get_attachment_link()`.

Improves logic of `get_attachment_link()` to validate parent post and resolution of inherited post status. This is an incomplete fix of #52373 to prevent the function returning links resulting in a file not found error. Required to unblock this ticket.

Props peterwilsoncc, TimothyBlynJacobs.
See #52373.
Fixes #5272.


git-svn-id: https://develop.svn.wordpress.org/trunk@50132 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-02 00:38:40 +00:00
..
category.php Build/Test Tools: Standardise the name, signature, and usage of the wpSetUpBeforeClass() method that's used in test classes. 2020-11-15 13:59:32 +00:00
customRules.php Docs: Improve inline comments per the documentation standards. 2020-01-29 00:43:23 +00:00
https.php Tests: First pass at using assertSame() instead of assertEquals() in most of the unit tests. 2020-09-02 00:35:36 +00:00
noRewrite.php Code Modernization: Replace dirname( __FILE__ ) calls with __DIR__ magic constant. 2020-02-06 06:31:22 +00:00
paged.php Canonical: Redirect paged requests for a static page assigned as the "Posts page". 2020-05-04 10:40:06 +00:00
pageOnFront.php Canonical: Redirect paged requests for a static page assigned as the "Posts page". 2020-05-04 10:40:06 +00:00
postStatus.php Canonical: Prevent ID enumeration of private post slugs. 2021-02-02 00:38:40 +00:00
robots.php Canonical: Move trailing slash handling for robots.txt and sitemaps to a single condition. 2020-06-25 11:39:23 +00:00
sitemaps.php Sitemaps: Prevent incorrect redirection of paged sitemap requests. 2020-08-27 01:28:24 +00:00