You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by "Daniel Fagerstrom (JIRA)" <ji...@apache.org> on 2007/01/13 20:03:27 UTC
[jira] Commented: (COCOON-1950)
org.apache.cocoon.blocks.util.RequestParameters incorrectly parses
Multi-byte symbols
[ https://issues.apache.org/jira/browse/COCOON-1950?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12464507 ]
Daniel Fagerstrom commented on COCOON-1950:
-------------------------------------------
Applied, thanks for the patch. Please check.
> org.apache.cocoon.blocks.util.RequestParameters incorrectly parses Multi-byte symbols
> -------------------------------------------------------------------------------------
>
> Key: COCOON-1950
> URL: https://issues.apache.org/jira/browse/COCOON-1950
> Project: Cocoon
> Issue Type: Bug
> Components: * Cocoon Core
> Affects Versions: 2.1.8, 2.1.9
> Reporter: Bohdan Mushkevych
>
> In cases, when request comes in unicode and contains both single byte and multi byte symbols, Cocoon processes them incorrectly
> The validator crashes with the requst like:
> http://localhost:8080/service?navigationID=/media/mmc2
> &selectionIDList=420000000000053228%09420000000000053227%09420000000000053226%09420000000000053225
> &selectionIDListDisp=%u4F0F%u5C14%u52A0%09%u4F0F%u5C14%u52A0%20%3E%20%u673A%u52A8%u8F66%09%u4F0F%u5C14%u52A0%20%3E%20%u673A%u52A8%u8F66%20%3E%20%u658B%09%u4F0F%u5C14%u52A0%20%3E%20%u673A%u52A8%u8F66%20%3E%20%u658B%20%3E%20%u5149%u5B66%u8BC6%u522B%u7CFB%u7EDF
> &selectionTopNList=420000000000053228%09%u4F0F%u5C14%u52A0%09420000000000053227%09%u4F0F%u5C14%u52A0%20%3E%20%u673A%u52A8%u8F66%09420000000000053226%09%u4F0F%u5C14%u52A0%20%3E%20%u673A%u52A8%u8F66%20%3E%20%u658B%09420000000000053225%09%u4F0F%u5C14%u52A0%20%3E%20%u673A%u52A8%u8F66%20%3E%20%u658B%20%3E%20%u5149%u5B66%u8BC6%u522B%u7CFB%u7EDF&
> As it stands from the code below, parseName method symply extracts 2 characters after % and works ok with pattrens %YY
> however, it does not handle %uXXXX correctly:
> private String parseName(String s)
> {
> StringBuffer sb = new StringBuffer();
> for(int i = 0; i < s.length(); i++)
> {
> char c = s.charAt(i);
> switch(c)
> {
> case 43: // '+'
> sb.append(' ');
> break;
> case 37: // '%'
> try
> {
> sb.append((char)Integer.parseInt(s.substring(i + 1, i + 3), 16));
> i += 2;
> break;
> ...
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira