Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2014-01-08 15:30:38 +01:00
commit 56af7a55ac
3 changed files with 27 additions and 28 deletions

View File

@ -14,6 +14,7 @@ phpMyAdmin - ChangeLog
+ rfe #1478 Make Column Headings Sticky
+ rfe #1480 Enhance privileges initials table
+ rfe #1472 [interface] Break "Edit privileges" with sub-menus
+ rfe #1466 Minor refactoring required
4.1.5.0 (not yet released)
- bug #3780 Allow aborting loading pages

View File

@ -4184,6 +4184,29 @@ class PMA_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(resource $curl_handle)
{
if (strlen($GLOBALS['cfg']['ProxyUrl'])) {
curl_setopt($curl_handle, CURLOPT_PROXY, $GLOBALS['cfg']['ProxyUrl']);
if (strlen($GLOBALS['cfg']['ProxyUser'])) {
curl_setopt(
$curl_handle,
CURLOPT_PROXYUSERPWD,
$GLOBALS['cfg']['ProxyUser'] . ':' . $GLOBALS['cfg']['ProxyPass']
);
}
}
return $curl_handle;
}
/**
* Returns information with latest version from phpmyadmin.net
*
@ -4191,8 +4214,6 @@ class PMA_Util
*/
public static function getLatestVersion()
{
global $cfg;
// wait 3s at most for server response, it's enough to get information
// from a working server
$connection_timeout = 3;
@ -4223,21 +4244,7 @@ class PMA_Util
);
} else if (function_exists('curl_init')) {
$curl_handle = curl_init($file);
if (strlen($cfg['ProxyUrl'])) {
curl_setopt(
$curl_handle,
CURLOPT_PROXY,
$cfg['ProxyUrl']
);
if (strlen($cfg['ProxyUser'])) {
curl_setopt(
$curl_handle,
CURLOPT_PROXYUSERPWD,
$cfg['ProxyUser']
. ':' . $cfg['ProxyPass']
);
}
}
$curl_handle = PMA_Util::configureCurl($curl_handle);
curl_setopt(
$curl_handle,
CURLOPT_HEADER,

View File

@ -7,7 +7,7 @@
*/
/*
* Include for handleContext (in sendErrorReport.
* Include for handleContext() and configureCurl in PMA_sendErrorReport()
*/
require_once 'libraries/Util.class.php';
@ -151,16 +151,7 @@ function PMA_sendErrorReport($report)
}
$curl_handle = curl_init(SUBMISSION_URL);
if (strlen($GLOBALS['cfg']['ProxyUrl'])) {
curl_setopt($curl_handle, CURLOPT_PROXY, $GLOBALS['cfg']['ProxyUrl']);
if (strlen($GLOBALS['cfg']['ProxyUser'])) {
curl_setopt(
$curl_handle,
CURLOPT_PROXYUSERPWD,
$GLOBALS['cfg']['ProxyUser'] . ':' . $GLOBALS['cfg']['ProxyPass']
);
}
}
$curl_handle = PMA_Util::configureCurl($curl_handle);
curl_setopt($curl_handle, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($curl_handle, CURLOPT_HTTPHEADER, array('Expect:'));
curl_setopt($curl_handle, CURLOPT_POSTFIELDS, $data_string);