Postgres: Safely escape strings in nested objects (#5855)
* Postgres: Safely handle string in nested objects * fix failing tests
This commit is contained in:
@@ -359,6 +359,24 @@ describe('Parse.Query testing', () => {
|
||||
}, done.fail);
|
||||
});
|
||||
|
||||
it('nested equalTo string with single quote', async () => {
|
||||
const obj = new TestObject({ nested: { foo: "single'quote" } });
|
||||
await obj.save();
|
||||
const query = new Parse.Query(TestObject);
|
||||
query.equalTo('nested.foo', "single'quote");
|
||||
const result = await query.get(obj.id);
|
||||
equal(result.get('nested').foo, "single'quote");
|
||||
});
|
||||
|
||||
it('nested containedIn string with single quote', async () => {
|
||||
const obj = new TestObject({ nested: { foo: ["single'quote"]} });
|
||||
await obj.save();
|
||||
const query = new Parse.Query(TestObject);
|
||||
query.containedIn('nested.foo', ["single'quote"]);
|
||||
const result = await query.get(obj.id);
|
||||
equal(result.get('nested').foo[0], "single'quote");
|
||||
});
|
||||
|
||||
it('nested containedIn string', done => {
|
||||
const sender1 = { group: ['A', 'B'] };
|
||||
const sender2 = { group: ['A', 'C'] };
|
||||
|
||||
Reference in New Issue
Block a user