even with EMULATE_PREPARES=false, sqlite still returns strings for int columns...
This commit is contained in:
parent
fd2d434c61
commit
19c4fcaf34
2 changed files with 7 additions and 4 deletions
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue