awake.php
6 years ago
cancelBackup.php
6 years ago
cancelDownload.php
6 years ago
checkBackupCreation.php
6 years ago
checkPHPVersionCompatibility.php
6 years ago
checkRestoreCreation.php
6 years ago
cloudDropbox.php
6 years ago
curlChecker.php
6 years ago
deleteBackup.php
6 years ago
dismissDiscountNotice.php
6 years ago
downloadBackup.php
6 years ago
getAction.php
6 years ago
getBackupContent.php
6 years ago
getRunningActions.php
6 years ago
hideNotice.php
6 years ago
importBackup.php
6 years ago
isFeatureAvailable.php
6 years ago
manualBackup.php
6 years ago
modalImport.php
6 years ago
modalManualBackup.php
6 years ago
modalManualRestore.php
6 years ago
modalPrivacy.php
6 years ago
modalReview.php
6 years ago
modalTerms.php
6 years ago
resetStatus.php
6 years ago
restore.php
6 years ago
reviewBannerActions.php
6 years ago
schedule.php
6 years ago
setReviewPopupState.php
6 years ago
setUserInfoVerificationPopupState.php
6 years ago
settings.php
6 years ago
storeSubscriberInfo.php
6 years ago
storeSurveyResult.php
6 years ago
checkPHPVersionCompatibility.php
35 lines
| 1 | <?php |
| 2 | |
| 3 | require_once(dirname(__FILE__).'/../boot.php'); |
| 4 | require_once(SG_LIB_PATH.'SGArchive.php'); |
| 5 | |
| 6 | if(backupGuardIsAjax() && count($_POST)) { |
| 7 | try { |
| 8 | $name = $_POST['bname']; |
| 9 | $name = backupGuardRemoveSlashes($name); |
| 10 | $path = SG_BACKUP_DIRECTORY.$name.'/'.$name.'.sgbp'; |
| 11 | |
| 12 | $sgArchive = new SGArchive($path, 'r'); |
| 13 | $headers = $sgArchive->getArchiveHeaders(); |
| 14 | |
| 15 | if (isset($headers['phpVersion'])) { |
| 16 | $oldPHPVersion = $headers['phpVersion']; |
| 17 | $currentVersion = phpversion(); |
| 18 | |
| 19 | // Drop the last digits of version (e.g. 5.3.3 will be 5) by explicit casting from string to int. This will check the migrations like php 5.x.x -> 7.x.x |
| 20 | if ((int)$oldPHPVersion != (int)$currentVersion) { |
| 21 | die(json_encode(array( |
| 22 | 'warning' => 'Warning: The backup has been captured for php '.$oldPHPVersion.' whereas your server is running php '.$currentVersion.'. If you’re sure the website is compatible with php '.$currentVersion.', please confirm to start the restoration.' |
| 23 | ))); |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | die(json_encode(array())); |
| 28 | } |
| 29 | catch(Exception $e) { |
| 30 | die(json_encode(array( |
| 31 | 'error' => $e->getMessage() |
| 32 | ))); |
| 33 | } |
| 34 | } |
| 35 |