Make WordPress Core

Opened 18 years ago

Closed 18 years ago

Last modified 17 years ago

#2551 closed defect (bug) (fixed)

Redirected enclosures not quite there yet

Reported by: aegrumet's profile aegrumet Owned by: markjaquith's profile markjaquith
Milestone: Priority: normal
Severity: normal Version: 2.0.1
Component: General Keywords: bg|has-patch bg|commit
Focuses: 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 (2)

enclosure-redirects-patch (814 bytes) - added by aegrumet 18 years ago.
enclosure-redirects-patch.txt (839 bytes) - added by aegrumet 18 years ago.
Same code, should be easier to read

Download all attachments as: .zip

Change History (10)

@aegrumet
18 years ago

Same code, should be easier to read

#1 @aegrumet
18 years ago

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

#2 @aegrumet
18 years ago

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.

#3 @davidhouse
18 years ago

  • Keywords bg|has-patch added

#4 @davidhouse
18 years ago

  • Keywords bg|needs-testing added

#5 @markjaquith
18 years ago

  • Keywords bg|commit added; bg|needs-testing removed
  • Milestone set to 2.0.3
  • Owner changed from anonymous to markjaquith
  • Status changed from new to assigned

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.

#6 @ryan
18 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

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

#7 @ryan
18 years ago

  • Resolution set to fixed

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

#8 @(none)
17 years ago

  • Milestone 2.0.3 deleted

Milestone 2.0.3 deleted

Note: See TracTickets for help on using tickets.