You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Yoshikazu Kuramochi (JIRA)" <de...@tapestry.apache.org> on 2007/12/19 04:15:43 UTC

[jira] Issue Comment Edited: (TAPESTRY-1988) Page activation paremeter with escaped ( %2f ) slash ( " / " ) character not passed correctly

    [ https://issues.apache.org/jira/browse/TAPESTRY-1988?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12553214 ] 

raku edited comment on TAPESTRY-1988 at 12/18/07 7:14 PM:
-------------------------------------------------------------------------

I think this issue related to

  https://issues.apache.org/jira/browse/TAPESTRY-1968
  https://issues.apache.org/jira/browse/TAPESTRY-1911

And, page activation context / component context contains utf8 string
is not decoded correctly (I tested Japanese characters).

I wrote patch to fix these problems.

Summary of this patch:

* Servlet container already decoded context,
  so does not use TapestryInternalUtils#urlDecode.

* But, servlet container does not decode '+' in path to ' ',
  so encode ' ' to %20 not to '+' in TapestryInternalUtils.

* Escaped slash (%2F) is also decoded by servlet container,
  then Tapestry can't distinct escaped slash from real slash.
  So escape slash in context to %2F before encode,
  then %2F is encoded to %252F in URLCodec#encode.
  (also % is escaped to %25 then encoded to %2525)
  And unescape in PageRenderDispatcher and ComponentActionDispatcher
  (TapestryInternalUtils#unescapePercentAndSlash).

* Add some tests.


      was (Author: raku):
    I think this issue related to

  https://issues.apache.org/jira/browse/TAPESTRY-1968
  https://issues.apache.org/jira/browse/TAPESTRY-1911

And, page activation context / component context contains utf8 string
does not decoded correctly (I tested Japanese characters).

I wrote patch to fix these problems.

Summary fo this patch:

* Servlet container already decoded context,
  so does not use TapestryInternalUtils#urlDecode.

* But, servlet container does not decode '+' in path to ' ',
  so encode ' ' to %20 not to '+' in TapestryInternalUtils.

* Escaped slash (%2F) is also decoded by servlet container,
  then Tapestry can't distinct escaped slash from real slash.
  So escape slash in context to %2F before encode,
  then %2F is encoded to %252F in URLCodec#encode.
  (also % is escaped to %25 then encoded to %2525)
  And unescape in PageRenderDispatcher and ComponentActionDispatcher
  (TapestryInternalUtils#unescapePercentAndSlash).

* Add some tests.

  
> Page activation paremeter with escaped ( %2f ) slash ( " / " ) character not passed correctly
> ---------------------------------------------------------------------------------------------
>
>                 Key: TAPESTRY-1988
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1988
>             Project: Tapestry
>          Issue Type: Bug
>    Affects Versions: 5.0.3, 5.0.4, 5.0.5, 5.0.6
>            Reporter: Kalin Krustev
>         Attachments: context_encode_decode_fix_to_5.0.6.patch, context_encode_decode_fix_to_trunk.patch
>
>
> Trying to pass string containing escaped slash as parameter value to onActivate() results in Tapestry interpreting it as passing two parameters.
> Example:
> test.java
> ============
> public class Test {
> 	private String param1;
> 	void onActivate(String p1){
> 		param1=p1;
> 	}
> 	public String getParam1() {
> 		return param1;
> 	}
> }
> test.tml
> ============
> <div test="true" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
>   Param 1:${Param1}
> </div>
> url
> ============
> http://localhost/test/aaa%2fbbb
> output
> ============
> aaa
> should output
> ============
> aaa/bbb

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org