https://www.mediawiki.org/wiki/Special:Code/MediaWiki/112466
Revision: 112466
Author: tstarling
Date: 2012-02-27 01:37:06 +0000 (Mon, 27 Feb 2012)
Log Message:
-----------
Make userAgent also work as an option to MWHttpRequest::factory() and
MWHttpRequest::__construct(), not just Http::request().
Modified Paths:
--------------
trunk/phase3/includes/HttpFunctions.php
Modified: trunk/phase3/includes/HttpFunctions.php
===================================================================
--- trunk/phase3/includes/HttpFunctions.php 2012-02-27 01:10:57 UTC (rev
112465)
+++ trunk/phase3/includes/HttpFunctions.php 2012-02-27 01:37:06 UTC (rev
112466)
@@ -43,9 +43,6 @@
}
$req = MWHttpRequest::factory( $url, $options );
- if( isset( $options['userAgent'] ) ) {
- $req->setUserAgent( $options['userAgent'] );
- }
$status = $req->execute();
if ( $status->isOK() ) {
@@ -210,6 +207,9 @@
} else {
$this->timeout = $wgHTTPTimeout;
}
+ if( isset( $options['userAgent'] ) ) {
+ $this->setUserAgent( $options['userAgent'] );
+ }
$members = array( "postData", "proxy", "noProxy",
"sslVerifyHost", "caInfo",
"method", "followRedirects", "maxRedirects",
"sslVerifyCert", "callback" );
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs