Fix low long rewriting parameter for char superior at 255.

This commit is contained in:
Christian P. MOMON 2013-12-01 05:15:19 +01:00
parent 762c758e4e
commit 57ea6a3c46

View file

@ -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;
}
}
}