[ofbiz-framework] branch trunk updated: Fixed: Unexpected decoding of url encoded textarea data after submission (OFBIZ-12249)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ofbiz-framework] branch trunk updated: Fixed: Unexpected decoding of url encoded textarea data after submission (OFBIZ-12249)

jleroux@apache.org
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 b9f785d  Fixed: Unexpected decoding of url encoded textarea data after submission  (OFBIZ-12249)
b9f785d is described below

commit b9f785d2fa21c16d8a3ac566b580cd6c7be00d1a
Author: Jacques Le Roux <[hidden email]>
AuthorDate: Thu Jun 10 09:21:05 2021 +0200

    Fixed: Unexpected decoding of url encoded textarea data after submission  (OFBIZ-12249)
   
    Oops, forgot to commit this checkstyle issue fix
---
 .../java/org/apache/ofbiz/base/util/UtilHttp.java  | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilHttp.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilHttp.java
index 6f040b4..8087090 100644
--- a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilHttp.java
+++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilHttp.java
@@ -412,7 +412,7 @@ public final class UtilHttp {
                     for (String s : stringValues) {
                         // if the string contains only an URL beginning by http or ftp => no change to keep special chars
                         if (UtilValidate.isValidUrl(s) && (s.indexOf("://") == 4 || s.indexOf("://") == 3)) {
-                            params = params + s + " " ;
+                            params = params + s + " ";
                         } else if (UtilValidate.isUrl(s) && !s.isEmpty()) {
                             // if the string contains not only an URL => concatenate possible canonicalized before and after, w/o changing the URL
                             String url = extractUrls(s).get(0); // THere should be only 1 URL in a block, makes no sense else
@@ -1725,16 +1725,16 @@ public final class UtilHttp {
         List<String> result = new ArrayList<String>();
 
         Pattern pattern = Pattern.compile(
-                "\\b(((ht|f)tp(s?)\\:\\/\\/|~\\/|\\/)|www.)" +
-                        "(\\w+:\\w+@)?(([-\\w]+\\.)+(com|org|net|gov" +
-                        "|mil|biz|info|mobi|name|aero|jobs|museum" +
-                        "|travel|[a-z]{2}))(:[\\d]{1,5})?" +
-                        "(((\\/([-\\w~!$+|.,=]|%[a-f\\d]{2})+)+|\\/)+|\\?|#)?" +
-                        "((\\?([-\\w~!$+|.,*:]|%[a-f\\d{2}])+=?" +
-                        "([-\\w~!$+|.,*:=]|%[a-f\\d]{2})*)" +
-                        "(&(?:[-\\w~!$+|.,*:]|%[a-f\\d{2}])+=?" +
-                        "([-\\w~!$+|.,*:=]|%[a-f\\d]{2})*)*)*" +
-                        "(#([-\\w~!$+|.,*:=]|%[a-f\\d]{2})*)?\\b");
+                "\\b(((ht|f)tp(s?)\\:\\/\\/|~\\/|\\/)|www.)"
+                        + "(\\w+:\\w+@)?(([-\\w]+\\.)+(com|org|net|gov"
+                        + "|mil|biz|info|mobi|name|aero|jobs|museum"
+                        + "|travel|[a-z]{2}))(:[\\d]{1,5})?"
+                        + "(((\\/([-\\w~!$+|.,=]|%[a-f\\d]{2})+)+|\\/)+|\\?|#)?"
+                        + "((\\?([-\\w~!$+|.,*:]|%[a-f\\d{2}])+=?"
+                        + "([-\\w~!$+|.,*:=]|%[a-f\\d]{2})*)"
+                        + "(&(?:[-\\w~!$+|.,*:]|%[a-f\\d{2}])+=?"
+                        + "([-\\w~!$+|.,*:=]|%[a-f\\d]{2})*)*)*"
+                        + "(#([-\\w~!$+|.,*:=]|%[a-f\\d]{2})*)?\\b");
 
         Matcher matcher = pattern.matcher(input);
         while (matcher.find()) {