diff --git a/core/database.php b/core/database.php index a38dd178..5a5a40cb 100644 --- a/core/database.php +++ b/core/database.php @@ -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); diff --git a/core/imageboard/image.php b/core/imageboard/image.php index c757e334..4ad9ae75 100644 --- a/core/imageboard/image.php +++ b/core/imageboard/image.php @@ -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); } }