diff options
author | patdenice <patdenice@piwigo.org> | 2010-12-11 20:01:35 +0000 |
---|---|---|
committer | patdenice <patdenice@piwigo.org> | 2010-12-11 20:01:35 +0000 |
commit | 2a741321ba0730e31614e364bdcecdb4e2f17c3a (patch) | |
tree | a3cd7d8e2f02d545f1fe059a92492139767d9d57 /admin/include | |
parent | 914045aad41afae100e33388e882c285c76ef321 (diff) |
Use POST to send server data
git-svn-id: http://piwigo.org/svn/trunk@8080 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | admin/include/functions.php | 13 |
1 files 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 = ''; |