Close #3934
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index 64ee880..d2bce5c 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -1751,7 +1751,7 @@
 		//
 		// Added exception for single quotes as well, we don't want to alter
 		// literal strings. -- Narf
-		if (strpos($item, '(') !== FALSE OR strpos($item, "'") !== FALSE)
+		if (strcspn($item, "()'") !== strlen($item))
 		{
 			return $item;
 		}