Make WordPress Core

Opened 16 years ago

Closed 16 years ago

#7085 closed enhancement (fixed)

MagpieRSS user-agent filter

Reported by: johnlamansky's profile JohnLamansky Owned by: westi's profile westi
Milestone: 2.7 Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch RSS Magpie
Focuses: Cc:

Description

Being able to customize the MagpieRSS user-agent would be useful for large WordPress sites (e.g. BuddyPress-powered social networks) who would want to identify themselves by their own site name instead of as "WordPress".

Attachments (3)

rss.php.diff (487 bytes) - added by JohnLamansky 16 years ago.
This patch would define the MAGPIE_USER_AGENT constant only if it hasn't already been defined. The constant could be defined through a manually-added constant definition in index.php, for example, or (preferably) via a plugin by hooking into the load_feed_engine action.
rss.php-2.diff (458 bytes) - added by JohnLamansky 16 years ago.
An alternate method, passing the user-agent through a filter instead of requiring a constant definition
rss.php-3.diff (547 bytes) - added by JohnLamansky 16 years ago.
A much better method

Download all attachments as: .zip

Change History (12)

@JohnLamansky
16 years ago

This patch would define the MAGPIE_USER_AGENT constant only if it hasn't already been defined. The constant could be defined through a manually-added constant definition in index.php, for example, or (preferably) via a plugin by hooking into the load_feed_engine action.

@JohnLamansky
16 years ago

An alternate method, passing the user-agent through a filter instead of requiring a constant definition

#1 @JohnLamansky
16 years ago

  • Keywords has-patch added

I've attached two different ways of doing this; I'll leave it up to the head developers to decide which one's better.

#2 @DD32
16 years ago

Would be better to just consolidate all the external access functions so that the user agent for all requests can be managed.. (#4779)

#3 follow-up: @JohnLamansky
16 years ago

Even if Magpie used a remote_http() function like you mention, one would have to manually change the rss.php code to add the desired user-agent as a parameter for all remote_http() calls. Therefore, a magpie_user_agent filter would be appropriate regardless of whether or not ticket 4479 is implemented.

#4 in reply to: ↑ 3 @DD32
16 years ago

Replying to JohnLamansky:

Even if Magpie used a remote_http() function like you mention, one would have to manually change the rss.php code to add the desired user-agent as a parameter for all remote_http() calls.

At the time, I was thinking of the Plugin adding itself to the User agent via a filter in the function for all requests. Not too sure how that'd work in retrospect though.

@JohnLamansky
16 years ago

A much better method

#5 @JohnLamansky
16 years ago

  • Summary changed from Allow customization of RSS user-agent to MagpieRSS user-agent filter

Ignore the first two attachments; I think rss.php-3.diff offers the most flexibility.

#6 @ryan
16 years ago

  • Milestone changed from 2.5.2 to 2.9

Milestone 2.5.2 deleted

#7 @JohnLamansky
16 years ago

  • Milestone changed from 2.9 to 2.6.1

#8 @westi
16 years ago

  • Milestone changed from 2.6.1 to 2.7
  • Owner changed from anonymous to westi
  • Status changed from new to assigned

#9 @westi
16 years ago

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

(In [8503]) Allow a plugin to change the filter the magpie user agent string. Fixes #7085 props JohnLamansky.

Note: See TracTickets for help on using tickets.