diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-03-01 18:40:06 +0100 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-03-01 18:40:06 +0100 |
commit | bb5dae46256cdcb0bcd204b6fa2fc628da6afb88 (patch) | |
tree | 058e70e73708290ea49d5ed5c6e8d58a166bb5d4 /system/database/DB_driver.php | |
parent | ca365356e49ee32a1f03aa2d58f452b2a494268c (diff) | |
parent | e3a68042c086acfc98ae273adbd8527af0c6ab8b (diff) |
Merge upstream branch
Diffstat (limited to 'system/database/DB_driver.php')
-rw-r--r-- | system/database/DB_driver.php | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index 6352c731e..5f435e363 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -185,20 +185,19 @@ class CI_DB_driver { /** * Set client character set * - * @access public * @param string * @param string - * @return resource + * @return bool */ - function db_set_charset($charset, $collation) + public function db_set_charset($charset, $collation = '') { - if ( ! $this->_db_set_charset($this->char_set, $this->dbcollat)) + if (method_exists($this, '_db_set_charset') && ! $this->_db_set_charset($charset, $collation)) { - log_message('error', 'Unable to set database connection charset: '.$this->char_set); + log_message('error', 'Unable to set database connection charset: '.$charset); if ($this->db_debug) { - $this->display_error('db_unable_to_set_charset', $this->char_set); + $this->display_error('db_unable_to_set_charset', $charset); } return FALSE; @@ -645,17 +644,12 @@ class CI_DB_driver { /** * Determines if a query is a "write" type. * - * @access public * @param string An SQL query string - * @return boolean + * @return bool */ - function is_write_type($sql) + public function is_write_type($sql) { - if ( ! preg_match('/^\s*"?(SET|INSERT|UPDATE|DELETE|REPLACE|CREATE|DROP|TRUNCATE|LOAD DATA|COPY|ALTER|GRANT|REVOKE|LOCK|UNLOCK)\s+/i', $sql)) - { - return FALSE; - } - return TRUE; + return (bool) preg_match('/^\s*"?(SET|INSERT|UPDATE|DELETE|REPLACE|CREATE|DROP|TRUNCATE|LOAD DATA|COPY|ALTER|RENAME|GRANT|REVOKE|LOCK|UNLOCK|OPTIMIZE)\s+/i', $sql); } // -------------------------------------------------------------------- @@ -1443,4 +1437,4 @@ class CI_DB_driver { } /* End of file DB_driver.php */ -/* Location: ./system/database/DB_driver.php */
\ No newline at end of file +/* Location: ./system/database/DB_driver.php */ |