Changeset 15680
- Timestamp:
- Jun 14, 2012, 11:46:47 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/updates.class.php
r13467 r15680 360 360 } 361 361 362 function upgrade_to($upgrade_to, &$step )362 function upgrade_to($upgrade_to, &$step, $check_current_version=true) 363 363 { 364 364 global $page, $conf, $template; 365 365 366 if ( !version_compare($_POST['upgrade_to'], PHPWG_VERSION, '>'))366 if ($check_current_version and !version_compare($upgrade_to, PHPWG_VERSION, '>')) 367 367 { 368 368 redirect(get_root_url().'admin.php?page=plugin-'.basename(dirname(__FILE__))); … … 372 372 { 373 373 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; 375 375 $dl_code = str_replace(array('.', '_'), '', $code); 376 376 $remove_path = $code; … … 379 379 else 380 380 { 381 $code = $ _POST['upgrade_to'];381 $code = $upgrade_to; 382 382 $dl_code = $code; 383 383 $remove_path = version_compare($code, '2.0.8', '>=') ? 'piwigo' : 'piwigo-'.$code; -
trunk/upgrade.php
r15679 r15680 229 229 ) 230 230 ); 231 232 // +-----------------------------------------------------------------------+ 233 // | Remote sites are not compatible with Piwigo 2.4+ | 234 // +-----------------------------------------------------------------------+ 235 236 $has_remote_site = false; 237 238 $query = 'SELECT galleries_url FROM '.SITES_TABLE.';'; 239 $result = pwg_query($query); 240 while ($row = pwg_db_fetch_assoc($result)) 241 { 242 if (url_is_remote($row['galleries_url'])) 243 { 244 $has_remote_site = true; 245 } 246 } 247 248 if ($has_remote_site) 249 { 250 include_once(PHPWG_ROOT_PATH.'admin/include/updates.class.php'); 251 include_once(PHPWG_ROOT_PATH.'admin/include/pclzip.lib.php'); 252 253 $page['errors'] = array(); 254 $step = 3; 255 updates::upgrade_to('2.3.4', $step, false); 256 257 if (!empty($page['errors'])) 258 { 259 echo '<ul>'; 260 foreach ($page['errors'] as $error) 261 { 262 echo '<li>'.$error.'</li>'; 263 } 264 echo '</ul>'; 265 } 266 267 exit(); 268 } 231 269 232 270 // +-----------------------------------------------------------------------+
Note: See TracChangeset
for help on using the changeset viewer.