diff options
author | plegall <plg@piwigo.org> | 2012-06-14 21:46:47 +0000 |
---|---|---|
committer | plegall <plg@piwigo.org> | 2012-06-14 21:46:47 +0000 |
commit | c89365f10e1703a08f33b1798bcaecd169aa8861 (patch) | |
tree | c9649a38f0a044d016d6d941230db9089fb97938 /admin/include/updates.class.php | |
parent | 754a12881d7a4c9a5bdc4a3456cb704822688630 (diff) |
feature 2632: add a test on upgrade.php, if a remote site is detected downgrade to 2.3.4
git-svn-id: http://piwigo.org/svn/trunk@15680 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | admin/include/updates.class.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/admin/include/updates.class.php b/admin/include/updates.class.php index 524b627a7..3a81fbb0f 100644 --- a/admin/include/updates.class.php +++ b/admin/include/updates.class.php @@ -359,11 +359,11 @@ class updates }
}
- function upgrade_to($upgrade_to, &$step)
+ function upgrade_to($upgrade_to, &$step, $check_current_version=true)
{
global $page, $conf, $template;
- if (!version_compare($_POST['upgrade_to'], PHPWG_VERSION, '>'))
+ if ($check_current_version and !version_compare($upgrade_to, PHPWG_VERSION, '>'))
{
redirect(get_root_url().'admin.php?page=plugin-'.basename(dirname(__FILE__)));
}
@@ -371,14 +371,14 @@ class updates if ($step == 2)
{
preg_match('/(\d+\.\d+)\.(\d+)/', PHPWG_VERSION, $matches);
- $code = $matches[1].'.x_to_'.$_POST['upgrade_to'];
+ $code = $matches[1].'.x_to_'.$upgrade_to;
$dl_code = str_replace(array('.', '_'), '', $code);
$remove_path = $code;
$obsolete_list = 'obsolete.list';
}
else
{
- $code = $_POST['upgrade_to'];
+ $code = $upgrade_to;
$dl_code = $code;
$remove_path = version_compare($code, '2.0.8', '>=') ? 'piwigo' : 'piwigo-'.$code;
$obsolete_list = PHPWG_ROOT_PATH.'install/obsolete.list';
|