فهرست منبع

fixed quote (again...)

Nicolas Cannasse 19 سال پیش
والد
کامیت
1d952ca5d0
1فایلهای تغییر یافته به همراه3 افزوده شده و 1 حذف شده
  1. 3 1
      std/neko/db/Sqlite.hx

+ 3 - 1
std/neko/db/Sqlite.hx

@@ -47,7 +47,9 @@ private class SqliteConnection implements Connection {
 	}
 
 	public function quote( s : String ) {
-		return "x'"+new String(untyped _encode(s.__s,"0123456789ABCDEF".__s))+"'";
+		if( s.indexOf("\000") >= 0 )
+			return "x'"+new String(untyped _encode(s.__s,"0123456789ABCDEF".__s))+"'";
+		return "'"+s.split("'").join("''")+"'";
 	}
 
 	public function lastInsertId() {