Opened 17 months ago
Last modified 16 months ago
#19918 new defect (bug)
Attachments are viewable from any permalink that matches their slug
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Permalinks | Version: | 3.2 |
| Severity: | major | Keywords: | has-patch dev-feedback |
| Cc: |
Description
I see one problem in WordPress, for example if you upload an images with name comments.png, all your url contain hide url like: /comments
example:
original post: yourdomain.com/myarticle
if you have in media gallery file with name comments.png url will be: yourdomain.com/myarticle/comments
or
yourdomain.com/myarticle2/comments
or
yourdomain.com/myarticle3/comments
and all this url's contain the same comment box.
my users report this problem, because if i share in twitter or g+ one link, many users redirect not to the post but to url with /comments in the end.
Adrian,
designmodo.com
Attachments (1)
Change History (11)
comment:2
SergeyBiryukov
— 17 months ago
Not sure what the problem is. My steps:
- Switched permalink structure to /%postname%/.
- Created and published a new post: /test8/
- On Edit Post screen, uploaded comments.jpg image.
- URL of the post is still the same (/test8/) and opens the post without a redirect.
- URL of the uploaded image is /test8/comments/ and opens the image.
comment:3
prorock
— 17 months ago
Sergey, try to create posts like /test9 and /test10 without upload any images and type in browser /test9/comments/ /test9/comments/ will appear the same image that in case of /test8/comments/
comment:4
SergeyBiryukov
— 17 months ago
Ah, I see. Confirmed.
comment:6
solarissmoke
— 17 months ago
- Component changed from Comments to Permalinks
- Summary changed from File name convert to URL to Attachments are viewable from any permalink that matches their slug
- Version changed from 3.3.1 to 3.2
This seems to be a wider issue than what was originally reported. Basically, you can view an attachment by appending it's slug to the link for any post! To reproduce:
- Use pretty permalinks (the exact structure doesn't matter)
- Add an attachment to a post (e.g., with attachment URL /2012/01/30/my-post/my-attachment/)
- Now you can view that attachment by appending the attachment slug to any other post. For example /2012/01/01/hello-world/my-attachment/ or /2011/11/01/another-random-post/my-attachment/.
The name of the attachment doesn't matter.
I can reproduce this in WP 3.2 (and 3.3, trunk). Don't have an earlier version running at the moment.
comment:7
prorock
— 17 months ago
- Version changed from 3.2 to 3.3.1
In 3.3.1 is the same problem, so don't change version :)
Thanks
comment:8
solarissmoke
— 17 months ago
- Version changed from 3.3.1 to 3.2
The version field is used to identify the earliest version at which the bug exists. Because it says 3.2 doesn't mean it doesn't exist in 3.3.
solarissmoke
— 16 months ago
comment:10
solarissmoke
— 16 months ago
- Keywords has-patch dev-feedback added
Here's a patch for starters. It fixes the issue for me, but I'm not too familiar with canonical so there is probably a better/more correct way to do it.
This would likely also effect images named page, feed, or trackback as well.