even with EMULATE_PREPARES=false, sqlite still returns strings for int columns...

This commit is contained in:
Shish 2019-09-30 10:40:15 +01:00
parent fd2d434c61
commit 19c4fcaf34
2 changed files with 7 additions and 4 deletions

View file

@ -87,7 +87,6 @@ class Database
$db_params = [
PDO::ATTR_PERSISTENT => $ka,
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_EMULATE_PREPARES => false, # return native types
];
$this->db = new PDO(DATABASE_DSN, $db_user, $db_pass, $db_params);

View file

@ -81,9 +81,13 @@ class Image
}
$this->locked = bool_escape($this->locked);
assert(is_int($this->id));
assert(is_int($this->height));
assert(is_int($this->width));
assert(is_numeric($this->id));
assert(is_numeric($this->height));
assert(is_numeric($this->width));
$this->id = int_escape($this->id);
$this->height = int_escape($this->height);
$this->width = int_escape($this->width);
}
}