From dc2a4b2da928de291cb24171ed65a2c69383b216 Mon Sep 17 00:00:00 2001 From: Kenji ITO Date: Sun, 16 Sep 2018 10:48:26 +0900 Subject: [PATCH] Fixed a bug where Rescue in install didn't work properly (issue #878) --- public_html/admin/install/rescue.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/public_html/admin/install/rescue.php b/public_html/admin/install/rescue.php index d80ac35cd..8821f8ce2 100644 --- a/public_html/admin/install/rescue.php +++ b/public_html/admin/install/rescue.php @@ -44,7 +44,7 @@ $configs = array( 'site_url', 'site_admin_url', 'site_mail', 'rdf_file', 'language', 'path_html', 'path_themes', 'path_editors', 'path_images', 'path_log', 'path_language', - 'backup_path', 'path_data', 'path_pear', 'theme', 'cookie_path', 'cookiedomain', + 'backup_path', 'path_data', 'theme', 'cookie_path', 'cookiedomain', ); // Start it off @@ -251,7 +251,7 @@ function render($renderType, $args = array()) { ', $passwd, $username, $site_url); $headers = 'MIME-Version: 1.0' . CRLB; $headers .= 'Content-type: text/html; charset=' . $LANG_CHARSET . CRLB; - $headers .= 'X-Mailer: PHP/' . phpversion(); + $headers .= 'X-Mailer: PHP/' . PHP_VERSION; if (mail($to, $subject, $message, $headers)) { $url = $self.'?view=options&args=result:success|statusMessage:' . urlencode(s(22)) . '&lang=' . urlencode($lang); echo "\n"; @@ -273,7 +273,7 @@ function render($renderType, $args = array()) {

@@ -298,10 +298,15 @@ function fatal_handler() { } } register_shutdown_function( "fatal_handler" ); - - $result = DB_query("SELECT * FROM {$_TABLES['plugins']}"); + + // Check if `conf_values` table exists $count = DB_count($_TABLES['conf_values']); - $count = DB_count($_TABLES['vars'], 'name', 'geeklog'); // Check if vars table exists and geeklog version record is found + if ($count == 0) { + trigger_error("Fatal error", E_USER_ERROR); + } + + // Check if `vars` table exists + $count = DB_count($_TABLES['vars']); if ($count == 0) { trigger_error("Fatal error", E_USER_ERROR); }