Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
V2 1.1.0, V2 1.2.0
-
None
-
None
-
All
Description
Handling of single quotes (‘) in the “formatLiteral” function (line 6879 in datajs-1.1.2.js) is broken if 'value' contains more than one occurrence. The relevant code is:
var formatLiteral = function (value, type) {
…
value = encodeURIComponent(value.replace("'", "''"));
The problem is that value.replace("'", "''") replaces only the first occurrence of ', not all of them which is the intended behavior. The code should be:
value = encodeURIComponent(value.replace(/'/g, "''"));