[geeklog-cvs] geeklog: Fixed warning in migration script when no backups are a...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sat Jul 4 11:32:01 EDT 2009


details:   http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/8f27dc3512cf
changeset: 7162:8f27dc3512cf
user:      Dirk Haun <dirk at haun-online.de>
date:      Sat Jul 04 16:26:35 2009 +0200
description:
Fixed warning in migration script when no backups are available (bug #0000918, patch provided by hiroron)

diffstat:

 public_html/admin/install/migrate.php |  12 +++++++-----
 public_html/docs/history              |   3 +++
 2 files changed, 10 insertions(+), 5 deletions(-)

diffs (35 lines):

diff -r 1aa777aacd39 -r 8f27dc3512cf public_html/admin/install/migrate.php
--- a/public_html/admin/install/migrate.php	Sat Jul 04 14:04:28 2009 +0200
+++ b/public_html/admin/install/migrate.php	Sat Jul 04 16:26:35 2009 +0200
@@ -326,11 +326,13 @@
             . '<p><label class="' . $form_label_dir . '">' . $LANG_INSTALL[47] . ' ' . INST_helpLink('site_admin_url') . '</label> <input type="text" name="site_admin_url" value="' . htmlspecialchars($site_admin_url) . '" size="50"' . XHTML . '>    ' . $LANG_INSTALL[46] . '</p>' . LB;
 
         // Identify the backup files in backups/ and order them newest to oldest
-        $sql_files = glob($backup_dir . '*.sql');
-        $tar_files = glob($backup_dir . '*.tar.gz');
-        $tgz_files = glob($backup_dir . '*.tgz');
-        $zip_files = glob($backup_dir . '*.zip');
-        $backup_files = array_merge($sql_files, $tar_files, $tgz_files, $zip_files);
+        $backup_files = array();
+        foreach (array('*.sql', '*.tar.gz', '*.tgz', '*.zip') as $pattern) {
+            $files = glob($backup_dir . $pattern);
+            if (is_array($files)) {
+                $backup_files = array_merge($backup_files, $files);
+            }
+        }
         rsort($backup_files);
 
         $display .= '<p><label class="' . $form_label_dir . '">' . $LANG_MIGRATE[6] . ' ' . INST_helpLink('migrate_file') . '</label>' . LB
diff -r 1aa777aacd39 -r 8f27dc3512cf public_html/docs/history
--- a/public_html/docs/history	Sat Jul 04 14:04:28 2009 +0200
+++ b/public_html/docs/history	Sat Jul 04 16:26:35 2009 +0200
@@ -11,6 +11,9 @@
 + Comment moderation and editable comments, by Jared Wenerd
 
 Changes since 1.6.0rc1:
+- Fixed warning in migration script when no backups are available (bug #0000918,
+  patch provided by hiroron)
+
 - Updated Estonian language files, provided by Artur Räpp
 - Updated Hebrew language files, provided by LWC
 - Updated Japanese language files and documentation, provided by the



More information about the geeklog-cvs mailing list