Fixes issue 9328: Prevent indexOutOfBounds when parsing a <text> tag
authorIván Perdomo <ivan.perdomo@openbravo.com>
Fri, 05 Jun 2009 09:20:10 +0200
changeset 3966 5251395c3c13
parent 3965 e055d58802b7
child 3967 0dd58cb2ec80
Fixes issue 9328: Prevent indexOutOfBounds when parsing a <text> tag
src-core/src/org/openbravo/uiTranslation/TranslationHandler.java
--- a/src-core/src/org/openbravo/uiTranslation/TranslationHandler.java	Thu Jun 04 23:33:26 2009 +0200
+++ b/src-core/src/org/openbravo/uiTranslation/TranslationHandler.java	Fri Jun 05 09:20:10 2009 +0200
@@ -173,7 +173,9 @@
           String text = inputLine.substring(start);
           text = text.replace(prefix, "");
           int end = text.indexOf(suffix);
-          text = text.substring(0, end);
+          if (end > 0) {
+            text = text.substring(0, end);
+          }
           String result = formLabels.get(text);
           if (formLabels.containsKey(text)) {
             inputLine = inputLine.replace(prefix + text + suffix, prefix + result + suffix);