From: Chad Horohoe Date: Tue, 28 Jan 2014 00:39:20 +0000 (-0800) Subject: Remove setting referrer from HttpFunctions X-Git-Tag: 1.31.0-rc.0~17115^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/?a=commitdiff_plain;h=609a76b1472bf9ade247428be5d4cec2180a8928;p=lhc%2Fweb%2Fwiklou.git Remove setting referrer from HttpFunctions It was introduced in 5d210b50 but no callers have ever been updated so this always falls back on $wgTitle (which is usually wrong). It only works on cURL, and is marginally useful at best. Change-Id: Ic498108af9f466cefbd0072f94f0efa4055cd169 --- diff --git a/includes/HttpFunctions.php b/includes/HttpFunctions.php index 9093c830aa..2536de1353 100644 --- a/includes/HttpFunctions.php +++ b/includes/HttpFunctions.php @@ -350,13 +350,6 @@ class MWHttpRequest { } } - /** - * Set the referrer header - */ - public function setReferer( $url ) { - $this->setHeader( 'Referer', $url ); - } - /** * Set the user agent * @param $UA string @@ -441,8 +434,6 @@ class MWHttpRequest { * @return Status */ public function execute() { - global $wgTitle; - wfProfileIn( __METHOD__ ); $this->content = ""; @@ -451,10 +442,6 @@ class MWHttpRequest { $this->headersOnly = true; } - if ( is_object( $wgTitle ) && !isset( $this->reqHeaders['Referer'] ) ) { - $this->setReferer( wfExpandUrl( $wgTitle->getFullURL(), PROTO_CURRENT ) ); - } - $this->proxySetup(); // set up any proxy as needed if ( !$this->callback ) { @@ -751,10 +738,6 @@ class CurlHttpRequest extends MWHttpRequest { $this->curlOptions[CURLOPT_MAXREDIRS] = $this->maxRedirects; $this->curlOptions[CURLOPT_ENCODING] = ""; # Enable compression - /* not sure these two are actually necessary */ - if ( isset( $this->reqHeaders['Referer'] ) ) { - $this->curlOptions[CURLOPT_REFERER] = $this->reqHeaders['Referer']; - } $this->curlOptions[CURLOPT_USERAGENT] = $this->reqHeaders['User-Agent']; $this->curlOptions[CURLOPT_SSL_VERIFYHOST] = $this->sslVerifyHost ? 2 : 0;