From 795b5a9aa04e8336f8039bf4fd3ddaf3228af3ea Mon Sep 17 00:00:00 2001 From: kaetemi Date: Mon, 8 Sep 2014 00:21:30 +0200 Subject: [PATCH] Don't write version if upgrade failed --- code/web/public_php/setup/database.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/code/web/public_php/setup/database.php b/code/web/public_php/setup/database.php index 75a3f0713..9a987b813 100644 --- a/code/web/public_php/setup/database.php +++ b/code/web/public_php/setup/database.php @@ -15,10 +15,12 @@ $db_ring_domain = 1; function set_db_version($continue_r, $name, $version) { $continue = $continue_r; - if (file_put_contents("db_version_" . $name, (string)$version)) { - } else { - printalert("danger", "Failed to set database version"); - $continue = false; + if ($continue) { + if (file_put_contents("db_version_" . $name, (string)$version)) { + } else { + printalert("danger", "Failed to set database version"); + $continue = false; + } } return $continue;