From 2a741321ba0730e31614e364bdcecdb4e2f17c3a Mon Sep 17 00:00:00 2001 From: patdenice Date: Sat, 11 Dec 2010 20:01:35 +0000 Subject: Use POST to send server data git-svn-id: http://piwigo.org/svn/trunk@8080 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/include/functions.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/admin/include/functions.php b/admin/include/functions.php index 8afae9981..4106501fb 100644 --- a/admin/include/functions.php +++ b/admin/include/functions.php @@ -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 = ''; -- cgit v1.2.3