Form validation and barcode input handling improvements

This commit is contained in:
Bernd Bestel
2017-04-17 16:51:49 +02:00
parent bd29f5da25
commit 2b8c672279
14 changed files with 242 additions and 103 deletions

View File

@@ -72,7 +72,11 @@ class GrocyDbMigrator
{
if ($pdo->query("SELECT COUNT(*) FROM migrations WHERE migration = $migrationId")->fetchColumn() == 0)
{
$pdo->exec(utf8_encode($sql));
if ($pdo->exec(utf8_encode($sql)) === false)
{
throw new Exception($pdo->errorInfo());
}
$pdo->exec('INSERT INTO migrations (migration) VALUES (' . $migrationId . ')');
}
}