Ignore:
Timestamp:
Nov 15, 2008, 10:11:58 PM (15 years ago)
Author:
patdenice
Message:

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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0/admin/include/plugins.class.php

    r2701 r2881  
    269269    $versions_to_check = array();
    270270    $url = PEM_URL . '/api/get_version_list.php?category_id=12&format=php';
    271     if ($source = @file_get_contents($url)
    272       and $pem_versions = @unserialize($source))
     271    if (fetchRemote($url, $result) and $pem_versions = @unserialize($result))
    273272    {
    274273      if (!preg_match('/^\d+\.\d+\.\d+/', $version))
     
    309308      $url .= implode(',', $plugins_to_check);
    310309    }
    311     if ($source = @file_get_contents($url))
    312     {
    313       $pem_plugins = @unserialize($source);
     310    if (fetchRemote($url, $result))
     311    {
     312      $pem_plugins = @unserialize($result);
    314313      if (!is_array($pem_plugins))
    315314      {
     
    322321      return true;
    323322    }
     323    return false;
    324324  }
    325325 
     
    358358      $url = PEM_URL . '/download.php?rid=' . $revision;
    359359      $url .= '&origin=piwigo_' . $action;
    360       if (@copy($url, $archive))
    361       {
     360
     361      if ($handle = @fopen($archive, 'wb') and fetchRemote($url, $handle))
     362      {
     363        fclose($handle);
    362364        include(PHPWG_ROOT_PATH.'admin/include/pclzip.lib.php');
    363365        $zip = new PclZip($archive);
Note: See TracChangeset for help on using the changeset viewer.