aboutsummaryrefslogtreecommitdiffstats
path: root/admin/include/plugins.class.php
diff options
context:
space:
mode:
authorpatdenice <patdenice@piwigo.org>2008-11-15 21:11:58 +0000
committerpatdenice <patdenice@piwigo.org>2008-11-15 21:11:58 +0000
commit3b0caa8de442a1028a78d2cf48aff4d3997729b3 (patch)
treea8510c714cd4223ae449dcbf7a62c726ecca0a29 /admin/include/plugins.class.php
parentb8322597d521357122b9b10c98a8e97203ced2ca (diff)
merge -c2880 from trunk to branch 2.0
- Add fetchRemote function which allow to retrieve datas over HTTP protocol using cURL method, file_get_contents function or fsockopen method. This allow to retrieve datas or files even if allow_url_fopen is deactivated. - Use fetchRemote function in plugins manager and in latest version checking. - Add german translations for upgrade.lang.php. - Remove empty line at the end of pclzip.lib.php. - Change display of deactivated plugins after upgrade. git-svn-id: http://piwigo.org/svn/branches/2.0@2881 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/include/plugins.class.php')
-rw-r--r--admin/include/plugins.class.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/admin/include/plugins.class.php b/admin/include/plugins.class.php
index ff478be83..13c2940a4 100644
--- a/admin/include/plugins.class.php
+++ b/admin/include/plugins.class.php
@@ -268,8 +268,7 @@ DELETE FROM ' . PLUGINS_TABLE . ' WHERE id="' . $plugin_id . '"';
$version = PHPWG_VERSION;
$versions_to_check = array();
$url = PEM_URL . '/api/get_version_list.php?category_id=12&format=php';
- if ($source = @file_get_contents($url)
- and $pem_versions = @unserialize($source))
+ if (fetchRemote($url, $result) and $pem_versions = @unserialize($result))
{
if (!preg_match('/^\d+\.\d+\.\d+/', $version))
{
@@ -308,9 +307,9 @@ DELETE FROM ' . PLUGINS_TABLE . ' WHERE id="' . $plugin_id . '"';
$url .= $new ? '&extension_exclude=' : '&extension_include=';
$url .= implode(',', $plugins_to_check);
}
- if ($source = @file_get_contents($url))
+ if (fetchRemote($url, $result))
{
- $pem_plugins = @unserialize($source);
+ $pem_plugins = @unserialize($result);
if (!is_array($pem_plugins))
{
return false;
@@ -321,6 +320,7 @@ DELETE FROM ' . PLUGINS_TABLE . ' WHERE id="' . $plugin_id . '"';
}
return true;
}
+ return false;
}
/**
@@ -357,8 +357,10 @@ DELETE FROM ' . PLUGINS_TABLE . ' WHERE id="' . $plugin_id . '"';
{
$url = PEM_URL . '/download.php?rid=' . $revision;
$url .= '&origin=piwigo_' . $action;
- if (@copy($url, $archive))
+
+ if ($handle = @fopen($archive, 'wb') and fetchRemote($url, $handle))
{
+ fclose($handle);
include(PHPWG_ROOT_PATH.'admin/include/pclzip.lib.php');
$zip = new PclZip($archive);
if ($list = $zip->listContent())