[wp-trac] [WordPress Trac] #38231: Allow download_url to respect content-disposition header
WordPress Trac
noreply at wordpress.org
Thu May 27 01:29:13 UTC 2021
#38231: Allow download_url to respect content-disposition header
--------------------------------------+------------------------------
Reporter: cklosows | Owner: johnjamesjacoby
Type: enhancement | Status: assigned
Priority: normal | Milestone: 5.9
Component: HTTP API | Version: 4.7
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests | Focuses:
--------------------------------------+------------------------------
Comment (by dd32):
[attachment:"38231-tests.2.diff"] Looks good to me @psrpinto! Thanks
The only thought I have is that the unlink could be moved to the else to
avoid a `file_exists()` call, but that's all I got :) I'll leave that up
to you or whomever commits this.
{{{
if ( tmpfname_disposition && rename ) {
set ...
} else if ( tmpfname_disposition ) {
unlink tmpfname_disposition
}
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/38231#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list