udittmer commented on PR #322:
URL: https://github.com/apache/jspwiki/pull/322#issuecomment-1833296214
This patch actually causes problems: something is off with encoding, so that
umlauts are mangled during saving. This happens because of the call to
**getParameter**. If (in WikiJSPFIlter) the method is called before the
super.doFilter call, the problem occurs. After doFilter, calling it causes no
problem. Rewriting the method so it looks at the query string solves the
problem:
```
static String parsePageFromURL( final HttpServletRequest request, final
Charset encoding ) {
String name = request.getPathInfo();
if( name == null || name.length() <= 1 ) {
name = request.getQueryString();
if (StringUtils.isNotBlank(name) && name.contains("page="))
return name.substring(name.indexOf("page=")+5);
else
return null;
} else if( name.charAt(0) == '/' ) {
return name.substring(1);
}
// This is required, because by default all URLs are handled as
Latin1, even if they are really UTF-8.
// name = TextUtil.urlDecode( name, encoding );
return name;
}
}
```
But I don't know enough of what is happening here to understand whether that
is the right thing to do.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]