Skip to content

Commit

Permalink
Echappement des simplequote dans les valeurs des variables échappées"
Browse files Browse the repository at this point in the history
  • Loading branch information
arno06 committed Dec 13, 2016
1 parent d3f4172 commit 1c49edc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Template.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ class Template extends EventEmitter
{
let value = this._getVariable(res[1], pData);
if(pEscapeString&& (typeof value )== "string")
value = "'"+value+"'";
value = "'"+value.replace(/\'/g, "\\'")+"'";
pString = pString.replace(res[0], value);
}
return pString;
Expand Down
2 changes: 1 addition & 1 deletion src/es5.Template.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ Class.define(Template, [EventDispatcher],
{
value = this._getVariable(res[1], pData);
if(pEscapeString&& (typeof value )== "string")
value = "'"+value+"'";
value = "'"+value.replace(/\'/g, "\\'")+"'";
pString = pString.replace(res[0], value);
}
return pString;
Expand Down

0 comments on commit 1c49edc

Please sign in to comment.