db-migrate/db-migrate-base

Escape doesn't escape anything at all when using double quotes

Opened this issue · 1 comments

return str.replace(/"/g, '"');

return str.replace(/"/g, '"');

The replacement string was probably meant to be '\\"'.

The code should be

return str.replace(/\\/g, '\\\\').replace(/"/g, '\\"');

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@pornel Yes you're right, that wont work quite well though. Thanks for point out :) Feel free to open a PR if you want to, I will have a look at this later on though.