Browse Source

Added code to detect when string that is being decoded and return ??? as the decoded string. This happens to strings that are already in UTF-8 format. The decoder returns the original string when this case is detected.

rkeil 8 years ago
parent
commit
031db3cc70
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/main/java/password/pwm/http/PwmHttpRequestWrapper.java

+ 4 - 0
src/main/java/password/pwm/http/PwmHttpRequestWrapper.java

@@ -362,9 +362,13 @@ public abstract class PwmHttpRequestWrapper {
         String decodedValue = input;
         try {
             decodedValue = new String(input.getBytes("ISO-8859-1"), PwmConstants.DEFAULT_CHARSET);
+            if (decodedValue.contains("?")) {
+                decodedValue = input;
+            }
         } catch (UnsupportedEncodingException e) {
             LOGGER.error("error decoding request parameter: " + e.getMessage());
         }
+
         return decodedValue;
     }