diff options
author | Andrey Andreev <narf@devilix.net> | 2016-01-06 13:51:27 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2016-01-06 13:51:27 +0100 |
commit | 0ca9ae6ca109177eb0e80456b097a9d63412517e (patch) | |
tree | 9c170e7d16a14751f78b2297d40df767d875e4fc /system/database/drivers/postgre/postgre_driver.php | |
parent | 0b1efb38293416b13aee8d1d9505e97d2efade5f (diff) |
Fix #4337
Diffstat (limited to 'system/database/drivers/postgre/postgre_driver.php')
-rw-r--r-- | system/database/drivers/postgre/postgre_driver.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php index b1df326f7..a7a02496b 100644 --- a/system/database/drivers/postgre/postgre_driver.php +++ b/system/database/drivers/postgre/postgre_driver.php @@ -288,7 +288,12 @@ class CI_DB_postgre_driver extends CI_DB { */ public function is_write_type($sql) { - return (bool) preg_match('/^\s*"?(SET|INSERT(?![^\)]+\)\s+RETURNING)|UPDATE(?!.*\sRETURNING)|DELETE|CREATE|DROP|TRUNCATE|LOAD|COPY|ALTER|RENAME|GRANT|REVOKE|LOCK|UNLOCK|REINDEX)\s/i', str_replace(array("\r\n", "\r", "\n"), ' ', $sql)); + if (preg_match('#^(INSERT|UPDATE).*RETURNING\s.+(\,\s?.+)*$#i', $sql)) + { + return FALSE; + } + + return parent::is_write_type($sql); } // -------------------------------------------------------------------- |