From 9aadf833566844adfdc462f425a43d42ffc1b698 Mon Sep 17 00:00:00 2001 From: Sascha Greuel Date: Tue, 2 Jul 2013 23:28:37 +0200 Subject: [PATCH] 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. --- wcfsetup/install/files/lib/util/HTTPRequest.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.20.1