From 3edb0d5df0be4cb96f16d741a2252abec6553264 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Mon, 6 Mar 2017 13:00:34 +0100 Subject: [PATCH] Fold configureCurl into httpRequestCurl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There is no longer need to have it separate. Signed-off-by: Michal Čihař --- libraries/Util.php | 36 +++++++++++------------------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/libraries/Util.php b/libraries/Util.php index 64eda190a4..aa37253be5 100644 --- a/libraries/Util.php +++ b/libraries/Util.php @@ -4170,30 +4170,6 @@ class Util } return $context; } - /** - * Updates an existing curl as necessary - * - * @param resource $curl_handle A curl_handle resource - * created by curl_init which should - * have several options set - * - * @return resource curl_handle with updated options - */ - public static function configureCurl($curl_handle) - { - if (strlen($GLOBALS['cfg']['ProxyUrl']) > 0) { - curl_setopt($curl_handle, CURLOPT_PROXY, $GLOBALS['cfg']['ProxyUrl']); - if (strlen($GLOBALS['cfg']['ProxyUser']) > 0) { - curl_setopt( - $curl_handle, - CURLOPT_PROXYUSERPWD, - $GLOBALS['cfg']['ProxyUser'] . ':' . $GLOBALS['cfg']['ProxyPass'] - ); - } - } - curl_setopt($curl_handle, CURLOPT_USERAGENT, 'phpMyAdmin/' . PMA_VERSION); - return $curl_handle; - } /** * Add fractional seconds to time, datetime and timestamp strings. @@ -4772,7 +4748,17 @@ class Util if ($curl_handle === false) { return null; } - $curl_handle = Util::configureCurl($curl_handle); + if (strlen($GLOBALS['cfg']['ProxyUrl']) > 0) { + curl_setopt($curl_handle, CURLOPT_PROXY, $GLOBALS['cfg']['ProxyUrl']); + if (strlen($GLOBALS['cfg']['ProxyUser']) > 0) { + curl_setopt( + $curl_handle, + CURLOPT_PROXYUSERPWD, + $GLOBALS['cfg']['ProxyUser'] . ':' . $GLOBALS['cfg']['ProxyPass'] + ); + } + } + curl_setopt($curl_handle, CURLOPT_USERAGENT, 'phpMyAdmin/' . PMA_VERSION); if ($method != "GET") { curl_setopt($curl_handle, CURLOPT_CUSTOMREQUEST, $method);