summaryrefslogtreecommitdiffstats
path: root/system/database
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-03-13 09:39:33 +0100
committerAndrey Andreev <narf@bofh.bg>2012-03-13 09:39:33 +0100
commitb0818b87ed0f6dda65399e6d97f28329fb72b1dc (patch)
treea96962212cb012be32ab09545dcd5c4dbdac05e2 /system/database
parent6b535f51fcb94e0a645fda0d0356f4748076877e (diff)
parent7c4870c3741e165bc7bc06624c816e66db474ee2 (diff)
Merge pull request #1177 from Eclarian/feature/db_toString_support
Adding Support to Properly Escape Objects that have __toString() magic method
Diffstat (limited to 'system/database')
-rw-r--r--system/database/DB_driver.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index 12cd3917c..bcff43392 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -670,7 +670,7 @@ class CI_DB_driver {
*/
public function escape($str)
{
- if (is_string($str))
+ if (is_string($str) OR method_exists($str, '__toString'))
{
$str = "'".$this->escape_str($str)."'";
}