diff options
author | patdenice <patdenice@piwigo.org> | 2008-11-15 21:10:05 +0000 |
---|---|---|
committer | patdenice <patdenice@piwigo.org> | 2008-11-15 21:10:05 +0000 |
commit | 59af44a8c2f4984e3d68321b5f4289833f8dddb1 (patch) | |
tree | d631241772ac50532f8329bbf1536110b857c7a7 /admin/include/plugins.class.php | |
parent | 78edf1906c93af1bad409d4e7c59ab6921888f32 (diff) |
- 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/trunk@2880 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | admin/include/plugins.class.php | 12 |
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()) |