Skip to content

Commit

Permalink
Fixed a bug where a compressed file containing no SQL files caused a …
Browse files Browse the repository at this point in the history
…blank screen during migration.
  • Loading branch information
mystralkk committed Dec 4, 2016
1 parent acf8674 commit 7b736c7
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 16 deletions.
26 changes: 17 additions & 9 deletions public_html/admin/install/classes/installer.class.php
Expand Up @@ -586,7 +586,7 @@ private function checkFileLocations()

// If the script was able to locate all the system files/directories move onto the next step
$args = array(
'mode' => 'check_permissions',
'mode' => 'check_permissions',
'dbconfig_path' => $this->env['dbconfig_path'],
);

Expand Down Expand Up @@ -3286,20 +3286,20 @@ private function unpackFile($backupPath, $backupFile, &$display)
$file = '';
$files = $archive->getList();

foreach ($files as $file) {
if (!isset($file['folder']) || !$file['folder']) {
if (preg_match('/\.sql$/', $file['filename'])) {
$dirName = preg_replace('/\/.*$/', '', $file['filename']);
$foundSqlFile = true;
break;
if (is_array($files) && (count($files) > 0)) {
foreach ($files as $file) {
if (!isset($file['folder']) || !$file['folder']) {
if (preg_match('/\.sql$/', $file['filename'])) {
$dirName = preg_replace('/\/.*$/', '', $file['filename']);
$foundSqlFile = true;
break;
}
}
}
}

if (!$foundSqlFile) {
// no .sql file found in archive
$display .= $this->getAlertMsg(sprintf($LANG_MIGRATE[40], $backupFile));

return false;
}

Expand Down Expand Up @@ -3927,6 +3927,14 @@ private function migrateStep3()
. '&site_url=' . urlencode($_REQUEST['site_url'])
. '&site_admin_url=' . urlencode($_REQUEST['site_admin_url']));
}
} else {
// No SQL file found
$backLink = 'index.php?'
. http_build_query(array(
'mode' => 'migrate',
'language' => $this->getLanguage(),
));
exit($this->getAlertMsg(sprintf($LANG_MIGRATE[40], $backupFile, $backLink)));
}
}

Expand Down
Expand Up @@ -237,7 +237,7 @@
37 => 'Migration Complete',
38 => 'The migration process has completed. However, the installation script found the following issues:',
39 => 'Failed to set PEAR include path. Sorry, can\'t handle compressed database backups without PEAR.',
40 => 'The archive \'%s\' does not appear to contain any SQL files.',
40 => 'The archive "%1$s" does not appear to contain any SQL files. To retry, click on <a href="%2$s\">this</a>',
41 => 'Error extracting database backup \'%s\' from compressed backup file.',
42 => 'Backup file \'%s\' just vanished ...',
43 => 'Import aborted: The file \'%s\' does not appear to be an SQL dump.',
Expand Down
Expand Up @@ -237,7 +237,7 @@
37 => 'Migration Complete',
38 => 'The migration process has completed. However, the installation script found the following issues:',
39 => 'Failed to set PEAR include path. Sorry, can\'t handle compressed database backups without PEAR.',
40 => 'The archive \'%s\' does not appear to contain any SQL files.',
40 => 'The archive "%1$s" does not appear to contain any SQL files. To retry, click on <a href="%2$s\">this</a>',
41 => 'Error extracting database backup \'%s\' from compressed backup file.',
42 => 'Backup file \'%s\' just vanished ...',
43 => 'Import aborted: The file \'%s\' does not appear to be an SQL dump.',
Expand Down
2 changes: 1 addition & 1 deletion public_html/admin/install/language/english.php
Expand Up @@ -236,7 +236,7 @@
37 => 'Migration Complete',
38 => 'The migration process has completed. However, the installation script found the following issues:',
39 => "Failed to set PEAR include path. Sorry, can't handle compressed database backups without PEAR.",
40 => "The archive '%s' does not appear to contain any SQL files.",
40 => 'The archive "%1$s" does not appear to contain any SQL files. To retry, click on <a href="%2$s\">this</a>',
41 => "Error extracting database backup '%s' from compressed backup file.",
42 => "Backup file '%s' just vanished ...",
43 => "Import aborted: The file '%s' does not appear to be an SQL dump.",
Expand Down
2 changes: 1 addition & 1 deletion public_html/admin/install/language/german.php
Expand Up @@ -236,7 +236,7 @@
37 => 'Migration abgeschlossen',
38 => 'Die Datenbank-Migration wurde erfolgreich abgeschlossen. Es wurden allerdings die folgenden Probleme gefunden:',
39 => 'Der Pfad f&uuml;r PEAR konnte nicht gesetzt werden. Ohne PEAR k&ouml;nnen leider keine komprimierten Datenbank-Backups importiert werden.',
40 => 'Das Archiv \'%s\' scheint keine SQL-Dateien zu enthalten.',
40 => 'Das Archiv "%1$s" scheint keine SQL-Dateien zu enthalten. Um es erneut zu versuchen, klicken Sie auf <a href="%2$s\"> hier.</a> ',
41 => 'Fehler beim extrahieren des Datenbank-Backups \'%s\' aus dem Archiv.',
42 => 'Backup-Datei \'%s\' nicht (mehr) auffindbar ...',
43 => 'Import abgebrochen: Die Datei \'%s\' scheint kein Datenbank-Backup zu sein.',
Expand Down
2 changes: 1 addition & 1 deletion public_html/admin/install/language/hebrew_utf-8.php
Expand Up @@ -231,7 +231,7 @@
37 => 'הנדידה הושלמה',
38 => 'תהליך הנדידה הושלם. עם זאת, סקריפט ההתקנה מצא את הדברים הבאים:',
39 => 'נכשלה הגדרת נתיב PEAR include. מצטערים, אין דרך לטפל בגיבויי מאגר מידע מכווצים בלי PEAR.',
40 => 'הארכיון \'%s\' לא נראה שמכיל קבצי SQL.',
40 => 'הארכיון "s$1%" לא נראה שהוא הכיל קבצי SQL. כדי לנסות שוב, לחץ על <a href="s$2%\"> </a> זה ',
41 => 'שגיאה בהוצאת גיבוי מאגר המידע \'%s\' מתוך קובץ הגיבוי המכווץ.',
42 => 'קובץ הגיבוי \'%s\' פשוט נעלם ...',
43 => 'היבוא בוטל. הקובץ \'%s\' לא נראה כמו SQL dump.',
Expand Down
2 changes: 1 addition & 1 deletion public_html/admin/install/language/japanese_utf-8.php
Expand Up @@ -238,7 +238,7 @@
37 => '移行完了',
38 => '移行プロセスは完了しました。次の問題があるので対応してください:',
39 => 'PEARが見つかりません。残念ながらPEARがない場合はバックアップの圧縮形式を処理できません。',
40 => '圧縮ファイル \'%s\' には、SQLファイルが含まれていません。',
40 => '圧縮ファイル "%1$s" には、SQLファイルが含まれていません。移行をやり直すには、<a href="%2$s">ここ</a>クリックしてください。',
41 => 'データベース \'%s\' におけるバックアップファイルの解凍でエラーが発生しました。',
42 => 'バックアップファイル \'%s\' が消えました...',
43 => 'インポートアボート: ファイル \'%s\'がSQLダンプで表示されません。',
Expand Down
2 changes: 1 addition & 1 deletion public_html/admin/install/language/polish.php
Expand Up @@ -236,7 +236,7 @@
37 => 'Migration Complete',
38 => 'The migration process has completed. However, the installation script found the following issues:',
39 => 'Failed to set PEAR include path. Sorry, can\'t handle compressed database backups without PEAR.',
40 => 'The archive \'%s\' does not appear to contain any SQL files.',
40 => 'The archive "%1$s" does not appear to contain any SQL files. To retry, click on <a href="%2$s\">this</a>',
41 => 'Error extracting database backup \'%s\' from compressed backup file.',
42 => 'Backup file \'%s\' just vanished ...',
43 => 'Import aborted: The file \'%s\' does not appear to be an SQL dump.',
Expand Down

0 comments on commit 7b736c7

Please sign in to comment.