X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=update.php;h=f59f9ef3e56c04397c6a2d7de718df1d7305f353;hb=f46192bb191acdbc733f60bad60c4eb83ebb2e26;hp=665ec94956ce5c6ff3f41fb581933c1ebeda3eed;hpb=155a2a53ffc4fac6299cc165cfc56114a61873f7;p=tt-rss.git diff --git a/update.php b/update.php index 665ec949..f59f9ef3 100644 --- a/update.php +++ b/update.php @@ -13,8 +13,13 @@ if (DB_TYPE == "pgsql") { pg_query($link, "set client_encoding = 'utf-8'"); pg_set_client_encoding("UNICODE"); + } else { + if (defined('MYSQL_CHARSET') && MYSQL_CHARSET) { + db_query($link, "SET NAMES " . MYSQL_CHARSET); +// db_query($link, "SET CHARACTER SET " . MYSQL_CHARSET); + } } - + login_sequence($link); $owner_uid = $_SESSION["uid"]; @@ -24,8 +29,7 @@ render_login_form($link); exit; } - - define('SCHEMA_VERSION', 16); + ?> @@ -83,18 +87,28 @@ function confirmOP() { ksort($update_versions, SORT_NUMERIC); $latest_version = max(array_keys($update_versions)); - + if ($version == $latest_version) { - print "

".__("Tiny Tiny RSS database is up to date.")."

"; - print "
- -
"; + + if ($version != SCHEMA_VERSION) { + print_error(__("Could not update database")); + + print "

" . + __("Could not find necessary schema file, need version:") . + " " . SCHEMA_VERSION . __(", found: ") . $latest_version . "

"; + + } else { + print "

".__("Tiny Tiny RSS database is up to date.")."

"; + print "
+ +
"; + } return; } if (!$op) { - print "

".__("Warning: Please backup your database before proceeding.")."

"; + print_warning(__("Please backup your database before proceeding.")); print "

" . T_sprintf("Your Tiny Tiny RSS database needs update to the latest version (%d to %d).", $version, $latest_version) . "

";