Use POST to send server data
git-svn-id: http://piwigo.org/svn/trunk@8080 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
parent
914045aad4
commit
2a741321ba
1 changed files with 6 additions and 7 deletions
|
@ -1722,18 +1722,13 @@ function fetchRemote($src, &$dest, $get_data=array(), $post_data=array(), $user_
|
|||
// After 3 redirections, return false
|
||||
if ($step > 3) return false;
|
||||
|
||||
// Initialization
|
||||
$method = empty($post_data) ? 'GET' : 'POST';
|
||||
$request = empty($post_data) ? '' : http_build_query($post_data, '', '&');
|
||||
$src = add_url_params($src, $get_data, '&');
|
||||
|
||||
// Send anonymous data to piwigo server
|
||||
if ($_SERVER['HTTP_HOST'] != 'localhost' and $step==0
|
||||
and preg_match('#^http://(?:[a-z]+\.)?piwigo\.org#', $src))
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$src = add_url_params($src, array(
|
||||
$post_data = array_merge($post_data, array(
|
||||
'uuid' => hash_hmac('md5', get_absolute_root_url(), $conf['secret_key']),
|
||||
'os' => urlencode(PHP_OS),
|
||||
'pwgversion' => urlencode(PHPWG_VERSION),
|
||||
|
@ -1742,9 +1737,13 @@ function fetchRemote($src, &$dest, $get_data=array(), $post_data=array(), $user_
|
|||
'dbversion' => urlencode(pwg_get_db_version()),
|
||||
)
|
||||
);
|
||||
$src = str_replace('&', '&', $src);
|
||||
}
|
||||
|
||||
// Initialization
|
||||
$method = empty($post_data) ? 'GET' : 'POST';
|
||||
$request = empty($post_data) ? '' : http_build_query($post_data, '', '&');
|
||||
$src = add_url_params($src, $get_data, '&');
|
||||
|
||||
// Initialize $dest
|
||||
is_resource($dest) or $dest = '';
|
||||
|
||||
|
|
Loading…
Reference in a new issue