[ofbiz-framework] branch release18.12 updated: Improved: SeoContextFilter.java is not able to handle query strings (OFBIZ-11278)

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

[ofbiz-framework] branch release18.12 updated: Improved: SeoContextFilter.java is not able to handle query strings (OFBIZ-11278)

jleroux@apache.org
This is an automated email from the ASF dual-hosted git repository.

jleroux pushed a commit to branch release18.12
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/release18.12 by this push:
     new 59b1ba1  Improved: SeoContextFilter.java is not able to handle query strings (OFBIZ-11278)
59b1ba1 is described below

commit 59b1ba17faece5939d479577ffa772dfe89d0454
Author: Jacques Le Roux <[hidden email]>
AuthorDate: Sun Nov 10 10:43:07 2019 +0100

    Improved: SeoContextFilter.java is not able to handle query strings
    (OFBIZ-11278)
   
    Removes a trailing blank and uses empty to check request::getParameterMap result
   
    Thanks: Mathieu to spot "empty to check request::getParameterMap result"
    (cherry picked from commit 61ade2add5af585ec873280da8051bdb1f139c71)
---
 .../main/java/org/apache/ofbiz/product/category/SeoContextFilter.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoContextFilter.java b/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoContextFilter.java
index 52e8017..b518ded 100644
--- a/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoContextFilter.java
+++ b/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoContextFilter.java
@@ -102,7 +102,7 @@ public class SeoContextFilter implements Filter {
         String uri = httpRequest.getRequestURI();
 
         Map<String, String[]> parameterMap =request.getParameterMap();
-        if (parameterMap != null) {
+        if (!parameterMap.isEmpty()) {
             List<BasicNameValuePair> params = new ArrayList<BasicNameValuePair>();
             request.getParameterMap().forEach((name, values) -> {
                 for(String value : values) {
@@ -110,7 +110,7 @@ public class SeoContextFilter implements Filter {
                 }
             });
             String queryString = URLEncodedUtils.format(params, Charset.forName("UTF-8"));
-            uri = uri + "?" + queryString;
+            uri = uri + "?" + queryString;
         }
         
         boolean forwarded = forwardUri(httpResponse, uri);