Explorar o código

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 %!s(int64=8) %!d(string=hai) anos
pai
achega
031db3cc70
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  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;
     }