This is an automated email from the ASF dual-hosted git repository. jleroux pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
The following commit(s) were added to refs/heads/trunk by this push: new 4316959ba8 Reverted: Improved: Use replace() instead of replaceAll() when a regex is not used (OFBIZ-10934) 4316959ba8 is described below commit 4316959ba87c2237dc1149dd44f0f3a9f17d93af Author: Jacques Le Roux <jacques.le.r...@les7arts.com> AuthorDate: Tue Oct 11 08:37:24 2022 +0200 Reverted: Improved: Use replace() instead of replaceAll() when a regex is not used (OFBIZ-10934) Reverts commit 198748b89d. I have to investigate what the pb is. Seems to be in MacroMenuRenderer --- .../org/apache/ofbiz/widget/renderer/macro/MacroFormRenderer.java | 4 ++-- .../org/apache/ofbiz/widget/renderer/macro/MacroMenuRenderer.java | 2 +- .../org/apache/ofbiz/widget/renderer/macro/MacroScreenRenderer.java | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroFormRenderer.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroFormRenderer.java index a1a7959ddf..3e4e88dddf 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroFormRenderer.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroFormRenderer.java @@ -715,7 +715,7 @@ public final class MacroFormRenderer implements FormStringRenderer { if (textSize > 0 && description.length() > textSize) { description = description.substring(0, textSize - 8) + "..." + description.substring(description.length() - 5); } - options.append(encode(description.replace("'", "\\\\\'"), modelFormField, context)); // related to OFBIZ-6504 + options.append(encode(description.replaceAll("'", "\\\\\'"), modelFormField, context)); // related to OFBIZ-6504 if (UtilValidate.isNotEmpty(currentValueList)) { options.append("'"); @@ -2818,7 +2818,7 @@ public final class MacroFormRenderer implements FormStringRenderer { Map<String, Object> paramMap = UtilHttp.getQueryStringOnlyParameterMap(queryString); String qbeString = (String) context.get("_QBESTRING_"); if (qbeString != null) { - qbeString = qbeString.replace("&", "&"); + qbeString = qbeString.replaceAll("&", "&"); paramMap.putAll(UtilHttp.getQueryStringOnlyParameterMap(qbeString)); } paramMap.put(modelForm.getSortFieldParameterName(), newSortField); diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroMenuRenderer.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroMenuRenderer.java index 4543339269..90178d2624 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroMenuRenderer.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroMenuRenderer.java @@ -124,7 +124,7 @@ public class MacroMenuRenderer implements MenuStringRenderer { Object value = parameter.getValue(); if (value instanceof String) { sb.append('"'); - sb.append(((String) value).replace("\"", "\\\\\"")); + sb.append(((String) value).replaceAll("\"", "\\\\\"")); sb.append('"'); } else { sb.append(value); diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroScreenRenderer.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroScreenRenderer.java index 09ab44dd64..0eb198c3db 100644 --- a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroScreenRenderer.java +++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroScreenRenderer.java @@ -125,7 +125,7 @@ public class MacroScreenRenderer implements ScreenStringRenderer { Object value = parameter.getValue(); if (value instanceof String) { sb.append('"'); - sb.append(((String) value).replace("\"", "\\\\\"")); + sb.append(((String) value).replaceAll("\"", "\\\\\"")); sb.append('"'); } else { sb.append(value); @@ -351,7 +351,7 @@ public class MacroScreenRenderer implements ScreenStringRenderer { sr.append("\" text=\""); sr.append(text); sr.append("\" imgStr=\""); - sr.append(imgStr.replace("\"", "\\\\\"")); + sr.append(imgStr.replaceAll("\"", "\\\\\"")); sr.append("\" />"); executeMacro(writer, sr.toString()); }