From dd5815ee8f1c0b1599dc41feef9fcd7fe23264fe Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Mon, 28 Jul 2008 17:06:40 +0000 Subject: [PATCH] =?UTF-8?q?-=20Correction=20d'erreur=20de=20syntaxe=20dans?= =?UTF-8?q?=20la=20composition=20d'expressions=20r=C3=A9guli=C3=A8res?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- trunk/includes/js/LSformElement_text.js | 4 ++-- trunk/includes/js/functions.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) 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]) ); }