不要怂,就是干,撸起袖子干!

Commit 593c382e by Sascha Depold

Merge branch 'master' of git://github.com/lmjohns3/sequelize into lmjohns3-master

2 parents 7d681b31 2e52cfdf
...@@ -182,7 +182,7 @@ module.exports = (function() { ...@@ -182,7 +182,7 @@ module.exports = (function() {
} }
} }
return hashToWhereConditions(hash) return hashToWhereConditions(hash).replace(/\\'/g, "''");
} }
} }
......
...@@ -48,6 +48,20 @@ if (dialect === 'sqlite') { ...@@ -48,6 +48,20 @@ if (dialect === 'sqlite') {
console.log(err) console.log(err)
}) })
}) })
it("escapes strings properly in where clauses", function(done) {
var self = this
this.User
.create({ username: "user'name" })
.success(function(user) {
self.User.findAll({
where: { username: "user'name" }
}).success(function(users) {
expect(users.length).toEqual(1)
done()
})
})
})
}) })
}) })
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!