aboutsummaryrefslogtreecommitdiffstats
path: root/admin/include/languages.class.php
diff options
context:
space:
mode:
authorpatdenice <patdenice@piwigo.org>2010-12-11 21:08:43 +0000
committerpatdenice <patdenice@piwigo.org>2010-12-11 21:08:43 +0000
commitea64e421cb529637a6aa7fad7b0b881b3c224fad (patch)
tree5fee4972f4dbf77c9be953a3e1259b4a6fcf619e /admin/include/languages.class.php
parent4ae512231a8817db2f0fbddafd3ed6195153d01c (diff)
feature 2057: use $get_data parameter to send GET data.
git-svn-id: http://piwigo.org/svn/trunk@8083 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/include/languages.class.php32
1 files changed, 21 insertions, 11 deletions
diff --git a/admin/include/languages.class.php b/admin/include/languages.class.php
index 88b37da36..d9537bbdd 100644
--- a/admin/include/languages.class.php
+++ b/admin/include/languages.class.php
@@ -196,13 +196,16 @@ UPDATE '.USER_INFOS_TABLE.'
{
global $user;
- $pem_category_id = 8;
+ $get_data = array(
+ 'category_id' => 8,
+ 'format' => 'php',
+ );
// Retrieve PEM versions
$version = PHPWG_VERSION;
$versions_to_check = array();
- $url = PEM_URL . '/api/get_version_list.php?category_id='.$pem_category_id.'&format=php';
- if (fetchRemote($url, $result) and $pem_versions = @unserialize($result))
+ $url = PEM_URL . '/api/get_version_list.php';
+ if (fetchRemote($url, $result, $get_data) and $pem_versions = @unserialize($result))
{
if (!preg_match('/^\d+\.\d+\.\d+/', $version))
{
@@ -223,11 +226,15 @@ UPDATE '.USER_INFOS_TABLE.'
}
// Retrieve PEM languages infos
- $url = PEM_URL . '/api/get_revision_list.php?category_id='.$pem_category_id.'&format=php&last_revision_only=true';
- $url .= '&version=' . implode(',', $versions_to_check);
- $url .= '&lang='.$user['language'];
-
- if (fetchRemote($url, $result))
+ $url = PEM_URL . '/api/get_revision_list.php';
+ $get_data = array_merge($get_data, array(
+ 'last_revision_only' => 'true',
+ 'version' => implode(',', $versions_to_check),
+ 'lang' => $user['language'],
+ )
+ );
+
+ if (fetchRemote($url, $result, $get_data))
{
$pem_languages = @unserialize($result);
if (!is_array($pem_languages))
@@ -258,10 +265,13 @@ UPDATE '.USER_INFOS_TABLE.'
{
if ($archive = tempnam( PHPWG_ROOT_PATH.'language', 'zip'))
{
- $url = PEM_URL . '/download.php?rid=' . $revision;
- $url .= '&origin=piwigo_' . $action;
+ $url = PEM_URL . '/download.php';
+ $get_data = array(
+ 'rid' => $revision,
+ 'origin' => 'piwigo_'.$action,
+ );
- if ($handle = @fopen($archive, 'wb') and fetchRemote($url, $handle))
+ if ($handle = @fopen($archive, 'wb') and fetchRemote($url, $handle, $get_data))
{
fclose($handle);
include(PHPWG_ROOT_PATH.'admin/include/pclzip.lib.php');