[wp-trac] Re: [WordPress Trac] #5065: Unify User-Agent strings

WordPress Trac wp-trac at lists.automattic.com
Thu Nov 15 08:52:46 GMT 2007


#5065: Unify User-Agent strings
------------------------------------------+---------------------------------
 Reporter:  docwhat                       |        Owner:  anonymous
     Type:  enhancement                   |       Status:  new      
 Priority:  normal                        |    Milestone:  2.4      
Component:  General                       |      Version:           
 Severity:  normal                        |   Resolution:           
 Keywords:  privacy user-agent has-patch  |  
------------------------------------------+---------------------------------
Comment (by DD32):

 I'm thinking a better method might be to wrap all outgoing http requests
 into a WP function. Currently theres a fair few fsockopen() scattered
 around the place, and theres Snoopy too, What would be better is a
 function such as:

 {{{
 function wp_get_remote($url,$headers=false){
 ...
 $userAgent = apply_filters('useragent',get_the_useragent());
 ...
 fsockopen()...
 if(!$headers)
 return $html;
 else
 return array($html,$headers);
 }
 }}}
 (Similar to {{{wp_get_http_headers()}}})

 Just makes more sense than changing the user agents in all these different
 locations to me, Why change the code in so many places when it could all
 just be consolidated in one swoop?, It would also help in adding Global
 Proxy support in.

 (Probably new ticket material, infact, i swear there is one, i just cant
 find it).

-- 
Ticket URL: <http://trac.wordpress.org/ticket/5065#comment:13>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list