[
https://issues.apache.org/jira/browse/OLINGO-249?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Daniel Molina updated OLINGO-249:
---------------------------------
Summary: 'formatLiteral' function escapes only the first occurrence of a
single quote instead of all of them (was: 'formatLiteral' function escapes
only the first occurrence of a single quote instead of all of the,)
> 'formatLiteral' function escapes only the first occurrence of a single quote
> instead of all of them
> ---------------------------------------------------------------------------------------------------
>
> Key: OLINGO-249
> URL: https://issues.apache.org/jira/browse/OLINGO-249
> Project: Olingo
> Issue Type: Bug
> Components: datajs
> Affects Versions: V2 1.1.0, V2 1.2.0
> Environment: All
> Reporter: Daniel Molina
>
> 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, "''"));
--
This message was sent by Atlassian JIRA
(v6.2#6252)