url_to_postid() doesn't resolve attachments when rewrite rules are disabled
|Reported by:||Coolkevman||Owned by:|
The code of url_to_postid() is pretty clear in the case of disabled rewrite rules: all URLs not using the p=N, page_id=N or attachment_id=N forms are not parsed and the function return 0. That make sense.
Now there is a special case for attachments. Attachments can be saved under a the /wp-content/uploads/year/month/ folder structure while rewrite rules are disabled at the same time.
This means there is a missed opportunity for url_to_postid() to resolve attachment's URLs of the long-form when rewrite rules are disabled.
This was tested and reproduced on WordPress 3.1.
Change History (12)
comment:5 follow-up: ↓ 6 c3mdigital — 8 months ago
- Resolution set to invalid
- Status changed from new to closed
- Version changed from 3.1 to 1.2
comment:6 in reply to: ↑ 5 ; follow-up: ↓ 9 MikeSchinkel — 8 months ago
- Keywords needs-patch added
- Resolution invalid deleted
- Status changed from closed to reopened
- Type changed from defect (bug) to feature request