From: Sascha Greuel Date: Tue, 2 Jul 2013 21:28:37 +0000 (+0200) Subject: Improved http_build_query (fixes reCAPTCHA) X-Git-Tag: 2.0.0_Beta_5~109^2^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9aadf833566844adfdc462f425a43d42ffc1b698;p=GitHub%2FWoltLab%2FWCF.git Improved http_build_query (fixes reCAPTCHA) As of PHP 5.3, the default seperator of http_build_query is arg_separator.input, which is in some cases "&". This may cause some unexpected problems i.e. reCAPTCHA doesn't work as intended. --- diff --git a/wcfsetup/install/files/lib/util/HTTPRequest.class.php b/wcfsetup/install/files/lib/util/HTTPRequest.class.php index f5a946660d..3c163a4fa5 100644 --- a/wcfsetup/install/files/lib/util/HTTPRequest.class.php +++ b/wcfsetup/install/files/lib/util/HTTPRequest.class.php @@ -105,7 +105,7 @@ final class HTTPRequest { $this->addHeader('Accept', '*/*'); $this->addHeader('Accept-Language', WCF::getLanguage()->getFixedLanguageCode()); if ($this->options['method'] !== 'GET') { - $this->addHeader('Content-length', strlen(http_build_query($this->postParameters))); + $this->addHeader('Content-length', strlen(http_build_query($this->postParameters, '', '&'))); $this->addHeader('Content-Type', 'application/x-www-form-urlencoded'); } if (isset($this->options['auth'])) { @@ -153,7 +153,7 @@ final class HTTPRequest { } $request .= "\r\n"; // add post parameters - if ($this->options['method'] !== 'GET') $request .= http_build_query($this->postParameters)."\r\n\r\n"; + if ($this->options['method'] !== 'GET') $request .= http_build_query($this->postParameters, '', '&')."\r\n\r\n"; $remoteFile->puts($request); $inHeader = true;