Skip to content

Commit

Permalink
Fix update not working if version < 3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
ssl authored Sep 11, 2020
1 parent 27b093a commit 9f6b10d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
}
Expand Down

0 comments on commit 9f6b10d

Please sign in to comment.