Ticket #2551 (closed defect (bug): fixed)
Redirected enclosures not quite there yet
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | General | Version: | 2.0.1 |
| Severity: | normal | Keywords: | bg|has-patch bg|commit |
| Cc: |
Description
Hi there,
I noticed that WP wasn't following HTTP redirects when auto-detecting enclosures in the post body.
On further digging I found a commit for this on trunk (functions.php r2956) but in my testing, enclosures still aren't always detected. It looks like the bugfix just needs a little work (patch to follow).
To reproduce, try linking to
which is a one-liner that redirects to an mp3 file on my server. Then check the RSS feed for an enclosure. There should be one but it's not there.
Attachments
Change History
-
attachment
enclosure-redirects-patch.txt
added
Same code, should be easier to read
Comments on the patchfile:
- No need to store $headersstatus_code?, a few lines down the same data is computed and stored in $headersresponse?. A quick grep of the tree didn't reveal any other instances of the string 'status_code', so presumably there are no side effects to stomping it back out (unless of course you like that name and want to get rid of 'response' everywhere ;) ).
- The preg_replace for $code wasn't returning sane results for me in any case. Not worth digging into if you agree with 1 above.
Oh, and importantly, the existing code was going right back to the original url, not following the Location header. That's fixed in the patch.
comment:5
markjaquith — 6 years ago
- Keywords bg|commit added; bg|needs-testing removed
- Owner changed from anonymous to markjaquith
- Status changed from new to assigned
- Milestone set to 2.0.3
Tested aegrumet's patch on /banches/2.0/ (2.0.3 pre-release) and it fixed the issue! Podcasting and videocasting are really taking off, and a lot of people are hosting at services that use redirection (e.g. CacheFly).
Double milestone for this one: 2.0.3 and 2.1, but 2.0.3 is more urgent.
- Status changed from assigned to closed
- Resolution set to fixed
- Resolution set to fixed
