Hi guys,

We found two issues on DataJS that we would like to get fixed. Can you advice 
on how to proceed?

Thanks,
Daniel


Issue 1
We found an issue in the handling of single quotes (') in the "formatLiteral" 
function (line 6879 in datajs-1.1.2.js):

    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, "''"));


Issue 2:
The jsonLightPayloadInfo function (line 7083 in datajs-1.1.2.js)  uses the URI 
coming from the metadata (data[metadataAnnotation]) and parses into more 
meaningful object  (fragment). The problem is that it never calls
decodeURIComponent to ensure data is represented correctly. Thus the lookup 
performed by  lookupEntitySet fails in scenarios where the URL data was escaped 
as container.entitySet uses non-escaped values. The fix should be (line 7112):

var fragment = decodeURIComponent(metadataUri.substring(fragmentStart + 1, 
fragmentEnd));


Reply via email to