switched from gettype() to is_* for testing type in escape()
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index 42b6a75..9385870 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -673,16 +673,19 @@
 	 * @return	integer		
 	 */	
 	function escape($str)
-	{	
-		switch (gettype($str))
+	{
+		if (is_string($str))
 		{
-			case 'string'	:	$str = "'".$this->escape_str($str)."'";
-				break;
-			case 'boolean'	:	$str = ($str === FALSE) ? 0 : 1;
-				break;
-			default			:	$str = ($str === NULL) ? 'NULL' : $str;
-				break;
-		}		
+			$str = "'".$this->escape_str($str)."'";
+		}
+		elseif (is_bool($str))
+		{
+			$str = ($str === FALSE) ? 0 : 1;
+		}
+		elseif (is_null($str))
+		{
+			$str = 'NULL';
+		}
 
 		return $str;
 	}