aboutsummaryrefslogtreecommitdiffstats
path: root/core/namespace
diff options
context:
space:
mode:
authorThomas Lange <code@nerdmind.de>2021-07-01 19:40:45 +0200
committerThomas Lange <code@nerdmind.de>2021-07-01 19:40:45 +0200
commita0fddb8470f33d7c66ff79cdbf9956290d72db25 (patch)
tree080c977735fa3df3dcf1df63c68f8b372b20583f /core/namespace
parent53bda002825112a0e121f063f659b53492fbb615 (diff)
downloadblog-a0fddb8470f33d7c66ff79cdbf9956290d72db25.tar.gz
blog-a0fddb8470f33d7c66ff79cdbf9956290d72db25.tar.xz
blog-a0fddb8470f33d7c66ff79cdbf9956290d72db25.zip
Bugfix: Explicitly check for FALSE in Migrator
Explicitly check for boolean FALSE because the result can be string "0" when directly upgrading from release v1.0 which has schema version "0".
Diffstat (limited to 'core/namespace')
-rw-r--r--core/namespace/Migrator.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/namespace/Migrator.php b/core/namespace/Migrator.php
index 1a05cc1..6eec9a5 100644
--- a/core/namespace/Migrator.php
+++ b/core/namespace/Migrator.php
@@ -16,7 +16,8 @@ class Migrator {
try {
$Statement = $Database->query('SELECT schema_version FROM migration');
- if(!$this->version = $Statement->fetchColumn()) {
+ # Explicitly check for FALSE, because result can be "0"
+ if(($this->version = $Statement->fetchColumn()) === FALSE) {
throw new Exception('The migration table does exist, but there is
no row containing the currently used on-disk schema version!');
}