Skip to content

Commit

Permalink
Added check for quote mark
Browse files Browse the repository at this point in the history
  • Loading branch information
timw4mail committed Oct 7, 2011
1 parent 2be33e8 commit 0e762b3
Showing 1 changed file with 5 additions and 21 deletions.
26 changes: 5 additions & 21 deletions system/database/drivers/pdo/pdo_driver.php
Expand Up @@ -313,7 +313,10 @@ function escape_str($str, $like = FALSE)
$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)
Expand Down Expand Up @@ -349,25 +352,7 @@ function affected_rows()
*/
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);
}

// --------------------------------------------------------------------
Expand Down Expand Up @@ -418,7 +403,6 @@ function _list_tables($prefix_limit = FALSE)

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
}

Expand Down

0 comments on commit 0e762b3

Please sign in to comment.