[wp-trac] [WordPress Trac] #60788: Content-Disposition support in download_url() seems broken
WordPress Trac
noreply at wordpress.org
Thu Aug 28 12:33:50 UTC 2025
#60788: Content-Disposition support in download_url() seems broken
--------------------------+------------------------------
Reporter: siliconforks | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: HTTP API | Version: 6.4.3
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
--------------------------+------------------------------
Comment (by siliconforks):
I guess [https://github.com/WordPress/wordpress-develop/pull/9654 PR
#9654] is an improvement over the current behavior, but I would still
prefer to just see the `Content-Disposition` support in `download_url()`
removed entirely.
1. The proposed PR doesn't entirely protect against concurrent access -
there is still a race condition (admittedly much less likely than before).
2. For the people who **do** want `Content-Disposition` support, it's not
clear they will actually be happy with the behavior proposed: the filename
is now no longer predictable, since it might have a `-1` (or a `-2`, or a
`-3`, etc.) in it.
3. The `Content-Disposition` functionality has a lot of other issues
besides the fundamental problem I've discussed here in #60788. (Some
examples: #63015, #63384.) It would take a lot of additional work to fix
these. I don't think it's really worth doing so much work when the entire
feature is fundamentally flawed and should not even exist in the first
place. Again, I think it would be better to simply remove all the
`Content-Disposition` functionality from `download_url()`.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/60788#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list