Fix bug [1926032] - Schedule incorrectly identified variables / safer way for backward commpatibility - to prevent if somebody already defined a variable with additional characters before or after

Link to SF Tracker: http://sourceforge.net/support/tracker.php?aid=1926032
This commit is contained in:
Carlos Ruiz 2010-03-14 00:47:58 +00:00
parent a8d4ee3e05
commit d92315b6d8
1 changed files with 2 additions and 1 deletions

View File

@ -301,7 +301,8 @@ public class Scheduler extends AdempiereServer
if (variable == null
|| (variable != null && variable.length() == 0))
value = null;
else if (variable.startsWith("@") && variable.endsWith("@")) // we have a variable / BF [1926032]
else if ( variable.indexOf('@') != -1
&& variable.indexOf('@') != variable.lastIndexOf('@')) // we have a variable / BF [1926032]
{
// Strip
int index = variable.indexOf('@');