From 57ea6a3c460123b5eba309fd812c7d8fe35c2d6a Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Sun, 1 Dec 2013 05:15:19 +0100 Subject: [PATCH] Fix low long rewriting parameter for char superior at 255. --- .../kiss4web/SimpleServletDispatcher.java | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/fr/devinsy/kiss4web/SimpleServletDispatcher.java b/src/fr/devinsy/kiss4web/SimpleServletDispatcher.java index 54b416b..faef36a 100755 --- a/src/fr/devinsy/kiss4web/SimpleServletDispatcher.java +++ b/src/fr/devinsy/kiss4web/SimpleServletDispatcher.java @@ -672,13 +672,25 @@ public class SimpleServletDispatcher extends HttpServlet { // logger.info("" + charIndex + " " + parameter.charAt(charIndex) + // " " + (char) tab[parameter.charAt(charIndex)]); - char car = (char) rewritingParameterMapping[parameter.charAt(charIndex)]; - if (car != NONE) + + char sourceCar = parameter.charAt(charIndex); + + char targetCar; + if (sourceCar > 255) { - if ((car != '-') || ((car == '-') && (previousCar != '-'))) + targetCar = '-'; + } + else + { + targetCar = (char) rewritingParameterMapping[sourceCar]; + } + + if (targetCar != NONE) + { + if ((targetCar != '-') || ((targetCar == '-') && (previousCar != '-'))) { - buffer.append(car); - previousCar = car; + buffer.append(targetCar); + previousCar = targetCar; } } }