summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/pdo/pdo_driver.php
diff options
context:
space:
mode:
authorTimothy Warren <tim@timshomepage.net>2011-10-07 15:21:40 +0200
committerTimothy Warren <tim@timshomepage.net>2011-10-07 15:21:40 +0200
commit0e762b32a003dd8a9b805fb95ee7aeb3616c41e3 (patch)
tree1f535b0713d2b160ad0d20df5ea4458e946ccb79 /system/database/drivers/pdo/pdo_driver.php
parent2be33e8762df028af678e775f07ebfefb9b8b334 (diff)
Added check for quote mark
Diffstat (limited to 'system/database/drivers/pdo/pdo_driver.php')
-rw-r--r--system/database/drivers/pdo/pdo_driver.php26
1 files changed, 5 insertions, 21 deletions
diff --git a/system/database/drivers/pdo/pdo_driver.php b/system/database/drivers/pdo/pdo_driver.php
index 1a84404bb..750c02e27 100644
--- a/system/database/drivers/pdo/pdo_driver.php
+++ b/system/database/drivers/pdo/pdo_driver.php
@@ -313,7 +313,10 @@ class CI_DB_pdo_driver extends CI_DB {
$str = $this->conn_id->quote($str);
//If there are duplicated quotes, trim them away
- $str = substr($str, 1, -1);
+ if(strpos($str, "'") === 0)
+ {
+ $str = substr($str, 1, -1);
+ }
// escape LIKE condition wildcards
if ($like === TRUE)
@@ -349,25 +352,7 @@ class CI_DB_pdo_driver extends CI_DB {
*/
function insert_id($name=NULL)
{
- //Convenience method for postgres insertid
- if(strpos($this->hostname, 'pgsql') !== FALSE)
- {
- $v = $this->_version();
-
- $table = func_num_args() > 0 ? func_get_arg(0) : NULL;
-
- if ($table == NULL && $v >= '8.1')
- {
- $sql='SELECT LASTVAL() as ins_id';
- }
- $query = $this->query($sql);
- $row = $query->row();
- return $row->ins_id;
- }
- else
- {
- return $this->conn_id->lastInsertId($name);
- }
+ return $this->conn_id->lastInsertId($name);
}
// --------------------------------------------------------------------
@@ -418,7 +403,6 @@ class CI_DB_pdo_driver extends CI_DB {
if ($prefix_limit !== FALSE AND $this->dbprefix != '')
{
- //$sql .= " LIKE '".$this->escape_like_str($this->dbprefix)."%' ".sprintf($this->_like_escape_str, $this->_like_escape_chr);
return FALSE; // not currently supported
}