From 7c44943ee45e5744238438b7fcedcfadbc9745d6 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Mon, 27 Feb 2012 01:37:06 +0000 Subject: [PATCH] Make userAgent also work as an option to MWHttpRequest::factory() and MWHttpRequest::__construct(), not just Http::request(). --- includes/HttpFunctions.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/HttpFunctions.php b/includes/HttpFunctions.php index 1018658450..23ea8df2cf 100644 --- a/includes/HttpFunctions.php +++ b/includes/HttpFunctions.php @@ -43,9 +43,6 @@ class Http { } $req = MWHttpRequest::factory( $url, $options ); - if( isset( $options['userAgent'] ) ) { - $req->setUserAgent( $options['userAgent'] ); - } $status = $req->execute(); if ( $status->isOK() ) { @@ -210,6 +207,9 @@ class MWHttpRequest { } else { $this->timeout = $wgHTTPTimeout; } + if( isset( $options['userAgent'] ) ) { + $this->setUserAgent( $options['userAgent'] ); + } $members = array( "postData", "proxy", "noProxy", "sslVerifyHost", "caInfo", "method", "followRedirects", "maxRedirects", "sslVerifyCert", "callback" ); -- 2.20.1