From 9f6b10d4759e578802c06e90d665bf5d1aa10a36 Mon Sep 17 00:00:00 2001 From: elyesa Date: Fri, 11 Sep 2020 13:47:58 +0200 Subject: [PATCH] Fix update not working if version < 3.5 --- src/User.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/User.php b/src/User.php index de7ad8c1..a82222d1 100644 --- a/src/User.php +++ b/src/User.php @@ -152,7 +152,11 @@ public function update() { } } - $this->database->query('UPDATE settings SET value = "' . version . '" WHERE setting = "version"'); + if(empty($currentVersion)) { + $this->database->query('INSERT INTO `settings` (`setting`, `value`) VALUES ("version", "' . version . '");'); + } else { + $this->database->query('UPDATE settings SET value = "' . version . '" WHERE setting = "version"'); + } return ['redirect' => 'dashboard']; }