Ticket #2551 (closed defect: fixed)

Opened 3 years ago

Last modified 2 years ago

Redirected enclosures not quite there yet

Reported by: aegrumet Assigned to: markjaquith
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

http://blog.grumet.net/etc/boing.php

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

enclosure-redirects-patch (0.8 kB) - added by aegrumet on 03/10/06 00:10:35.
enclosure-redirects-patch.txt (0.8 kB) - added by aegrumet on 03/10/06 00:11:58.
Same code, should be easier to read

Change History

03/10/06 00:10:35 changed by aegrumet

  • attachment enclosure-redirects-patch added.

03/10/06 00:11:58 changed by aegrumet

  • attachment enclosure-redirects-patch.txt added.

Same code, should be easier to read

03/10/06 00:16:57 changed by aegrumet

Comments on the patchfile:

1. 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 ;) ).

2. 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.

03/10/06 00:19:22 changed by aegrumet

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.

03/10/06 17:25:17 changed by davidhouse

  • keywords set to bg|has-patch.

03/10/06 17:25:41 changed by davidhouse

  • keywords changed from bg|has-patch to bg|has-patch bg|needs-testing.

05/02/06 11:26:28 changed by markjaquith

  • keywords changed from bg|has-patch bg|needs-testing to bg|has-patch bg|commit.
  • 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.

05/26/06 17:25:22 changed by ryan

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [3792]) Enclosure redirect fix from aegrumet. fixes #2551

05/26/06 17:25:50 changed by ryan

  • status changed from closed to closed.
  • resolution set to fixed.

(In [3793]) Enclosure redirect fix from aegrumet. fixes #2551

11/30/06 19:41:50 changed by

  • milestone deleted.

Milestone 2.0.3 deleted