Change SQLite _execute() to use is_write_type()
diff --git a/system/database/drivers/sqlite/sqlite_driver.php b/system/database/drivers/sqlite/sqlite_driver.php
index 20b05af..8116cfb 100644
--- a/system/database/drivers/sqlite/sqlite_driver.php
+++ b/system/database/drivers/sqlite/sqlite_driver.php
@@ -154,13 +154,9 @@
protected function _execute($sql)
{
$sql = $this->_prep_query($sql);
-
- if ( ! preg_match('/^(SELECT|EXPLAIN).+$/i', ltrim($sql)))
- {
- return @sqlite_exec($this->conn_id, $sql);
- }
-
- return @sqlite_query($this->conn_id, $sql);
+ return $this->is_write_type($sql)
+ ? @sqlite_exec($this->conn_id, $sql)
+ : @sqlite_query($this->conn_id, $sql);
}
// --------------------------------------------------------------------