diff --git a/trunk/includes/js/LSformElement_text.js b/trunk/includes/js/LSformElement_text.js index b8a03ae5..8bd5cfc4 100644 --- a/trunk/includes/js/LSformElement_text.js +++ b/trunk/includes/js/LSformElement_text.js @@ -24,14 +24,14 @@ var LSformElement_text = new Class({ getDependsFields: function(format) { var retval=new Array(); var find = 1; - var getMotif = /%{([A-Za-z0-9]+)}/ + var getMotif = new RegExp('%\{([A-Za-z0-9]+)\}'); var ch = null; while (find) { ch = getMotif.exec(format); if ($type(ch)) { retval.include(ch[1]); format=format.replace ( - new RegExp('%{'+ch[1]+'}'), + new RegExp('%\{'+ch[1]+'\}'), '' ); } diff --git a/trunk/includes/js/functions.js b/trunk/includes/js/functions.js index 9f94a081..194d2985 100644 --- a/trunk/includes/js/functions.js +++ b/trunk/includes/js/functions.js @@ -34,7 +34,7 @@ function LSdebug() { * @retval string La chaine formatée */ function getFData(format,data,meth) { - var getMotif = /%{([A-Za-z0-9]+)}/ + var getMotif = new RegExp('%\{([A-Za-z0-9]+)\}'); var find=1; if(($type(data)=='object') || ($type(data)=='array')) { if ($type(data[meth])!='function') { @@ -42,7 +42,7 @@ function getFData(format,data,meth) { var ch = getMotif.exec(format); if ($type(ch)) { format=format.replace ( - new RegExp('%{'+ch[1]+'}'), + new RegExp('%\{'+ch[1]+'\}'), data[ch[1]] ); } @@ -57,7 +57,7 @@ function getFData(format,data,meth) { if ($type(ch)) { try { format=format.replace ( - new RegExp('%{'+ch[1]+'}'), + new RegExp('%\{'+ch[1]+'\}'), data[meth](ch[1]) ); }