Changeset 15680 for trunk/admin


Ignore:
Timestamp:
Jun 14, 2012, 11:46:47 PM (12 years ago)
Author:
plg
Message:

feature 2632: add a test on upgrade.php, if a remote site is detected downgrade to 2.3.4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/updates.class.php

    r13467 r15680  
    360360  }
    361361
    362   function upgrade_to($upgrade_to, &$step)
     362  function upgrade_to($upgrade_to, &$step, $check_current_version=true)
    363363  {
    364364    global $page, $conf, $template;
    365365
    366     if (!version_compare($_POST['upgrade_to'], PHPWG_VERSION, '>'))
     366    if ($check_current_version and !version_compare($upgrade_to, PHPWG_VERSION, '>'))
    367367    {
    368368      redirect(get_root_url().'admin.php?page=plugin-'.basename(dirname(__FILE__)));
     
    372372    {
    373373      preg_match('/(\d+\.\d+)\.(\d+)/', PHPWG_VERSION, $matches);
    374       $code =  $matches[1].'.x_to_'.$_POST['upgrade_to'];
     374      $code =  $matches[1].'.x_to_'.$upgrade_to;
    375375      $dl_code = str_replace(array('.', '_'), '', $code);
    376376      $remove_path = $code;
     
    379379    else
    380380    {
    381       $code = $_POST['upgrade_to'];
     381      $code = $upgrade_to;
    382382      $dl_code = $code;
    383383      $remove_path = version_compare($code, '2.0.8', '>=') ? 'piwigo' : 'piwigo-'.$code;
Note: See TracChangeset for help on using the changeset viewer.