From 5a8666c36ac3aba4982b71e62e7e6cdd50b84849 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Mon, 29 Aug 2016 11:21:50 +0200 Subject: [PATCH] Fix allow_url_fopen request handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issue #12465 Signed-off-by: Michal Čihař --- libraries/Util.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/libraries/Util.php b/libraries/Util.php index b9a17c5328..0cbc53e2d8 100644 --- a/libraries/Util.php +++ b/libraries/Util.php @@ -4959,12 +4959,18 @@ class Util $context = array( 'http' => array( 'method' => $method, - 'content' => $content, - 'header' => $header, 'request_fulluri' => true, - 'timeout' => $connection_timeout + 'timeout' => $connection_timeout, + 'header' => "Accept: */*\nUser-Agent: phpMyAdmin", ) ); + if ($header) { + $context['http']['header'] .= "\nExpect: ". $header; + } + if ($method == "POST") { + $context['http']['content'] = $content; + } + $context = Util::handleContext($context); $response = @file_get_contents( $url,