[jira] [Commented] (MYFACES-4638) Inputs submitted by AJAX loose all content beginning with ampersand ("&") characters

2023-11-08 Thread Andreas Osterburg (Jira)


[ 
https://issues.apache.org/jira/browse/MYFACES-4638?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17784202#comment-17784202
 ] 

Andreas Osterburg commented on MYFACES-4638:


Thank you.

> Inputs submitted by AJAX loose all content beginning with ampersand ("&") 
> characters
> 
>
> Key: MYFACES-4638
> URL: https://issues.apache.org/jira/browse/MYFACES-4638
> Project: MyFaces Core
>  Issue Type: Bug
>Affects Versions: 4.0.0, 5.0.0
>Reporter: Andreas Osterburg
>Assignee: Werner Punz
>Priority: Major
> Fix For: 4.0.2, 4.1.0, 5.0.0
>
> Attachments: patch-FileUtils.txt, test.xhtml
>
>
> When submitting input fields with AJAX the ampersand "&" character is not 
> handled properly on client side.
> A test case ist attached. Just submitting the form works as expected, 
> submitting by AJAX
> fails if input contains "&"-signs, like "foo".
> It tracked this down to the function _decodeEncodedValues_ in 
> {_}FileUtils.ts{_}. There happens a
> decode of the current ViewState in URI-encoded format.
> Basically the source of the issue is that the input string (in 
> "{_}encoded"){_} is processed in wrong order.
> Currently it is first URI-decoded an then splitted by ampersands ("&"). It 
> has to be in
> reverse order, since the payload may contain ampersands, which are 
> URI-encoded by "%26".
> A small working patch for demonstration is attached.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MYFACES-4638) Inputs submitted by AJAX loose all content beginning with ampersand ("&") characters

2023-11-08 Thread Werner Punz (Jira)


[ 
https://issues.apache.org/jira/browse/MYFACES-4638?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17784108#comment-17784108
 ] 

Werner Punz commented on MYFACES-4638:
--

Fixed

 

> Inputs submitted by AJAX loose all content beginning with ampersand ("&") 
> characters
> 
>
> Key: MYFACES-4638
> URL: https://issues.apache.org/jira/browse/MYFACES-4638
> Project: MyFaces Core
>  Issue Type: Bug
>Affects Versions: 4.0.0, 5.0.0
>Reporter: Andreas Osterburg
>Assignee: Werner Punz
>Priority: Major
> Fix For: 4.0.2, 4.1.0, 5.0.0
>
> Attachments: patch-FileUtils.txt, test.xhtml
>
>
> When submitting input fields with AJAX the ampersand "&" character is not 
> handled properly on client side.
> A test case ist attached. Just submitting the form works as expected, 
> submitting by AJAX
> fails if input contains "&"-signs, like "foo".
> It tracked this down to the function _decodeEncodedValues_ in 
> {_}FileUtils.ts{_}. There happens a
> decode of the current ViewState in URI-encoded format.
> Basically the source of the issue is that the input string (in 
> "{_}encoded"){_} is processed in wrong order.
> Currently it is first URI-decoded an then splitted by ampersands ("&"). It 
> has to be in
> reverse order, since the payload may contain ampersands, which are 
> URI-encoded by "%26".
> A small working patch for demonstration is attached.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MYFACES-4638) Inputs submitted by AJAX loose all content beginning with ampersand ("&") characters

2023-11-08 Thread Werner Punz (Jira)


[ 
https://issues.apache.org/jira/browse/MYFACES-4638?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17784088#comment-17784088
 ] 

Werner Punz commented on MYFACES-4638:
--

Seems like the fix is not entirely complete I am getting a cut off part after 
the & in my unit test, I need to debug this out!

 

> Inputs submitted by AJAX loose all content beginning with ampersand ("&") 
> characters
> 
>
> Key: MYFACES-4638
> URL: https://issues.apache.org/jira/browse/MYFACES-4638
> Project: MyFaces Core
>  Issue Type: Bug
>Affects Versions: 4.0.0, 5.0.0
>Reporter: Andreas Osterburg
>Assignee: Werner Punz
>Priority: Major
> Fix For: 4.0.2, 4.1.0, 5.0.0
>
> Attachments: patch-FileUtils.txt, test.xhtml
>
>
> When submitting input fields with AJAX the ampersand "&" character is not 
> handled properly on client side.
> A test case ist attached. Just submitting the form works as expected, 
> submitting by AJAX
> fails if input contains "&"-signs, like "foo".
> It tracked this down to the function _decodeEncodedValues_ in 
> {_}FileUtils.ts{_}. There happens a
> decode of the current ViewState in URI-encoded format.
> Basically the source of the issue is that the input string (in 
> "{_}encoded"){_} is processed in wrong order.
> Currently it is first URI-decoded an then splitted by ampersands ("&"). It 
> has to be in
> reverse order, since the payload may contain ampersands, which are 
> URI-encoded by "%26".
> A small working patch for demonstration is attached.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MYFACES-4638) Inputs submitted by AJAX loose all content beginning with ampersand ("&") characters

2023-11-08 Thread Werner Punz (Jira)


[ 
https://issues.apache.org/jira/browse/MYFACES-4638?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17784083#comment-17784083
 ] 

Werner Punz commented on MYFACES-4638:
--

Patch works, my existing tests pass, but I want to add a dedicated test for 
this exact usecase in my unit tests!

So be patient, I will issue a merge request later today for 4 +

> Inputs submitted by AJAX loose all content beginning with ampersand ("&") 
> characters
> 
>
> Key: MYFACES-4638
> URL: https://issues.apache.org/jira/browse/MYFACES-4638
> Project: MyFaces Core
>  Issue Type: Bug
>Affects Versions: 4.0.0, 5.0.0
>Reporter: Andreas Osterburg
>Assignee: Werner Punz
>Priority: Major
> Fix For: 4.0.2, 4.1.0, 5.0.0
>
> Attachments: patch-FileUtils.txt, test.xhtml
>
>
> When submitting input fields with AJAX the ampersand "&" character is not 
> handled properly on client side.
> A test case ist attached. Just submitting the form works as expected, 
> submitting by AJAX
> fails if input contains "&"-signs, like "foo".
> It tracked this down to the function _decodeEncodedValues_ in 
> {_}FileUtils.ts{_}. There happens a
> decode of the current ViewState in URI-encoded format.
> Basically the source of the issue is that the input string (in 
> "{_}encoded"){_} is processed in wrong order.
> Currently it is first URI-decoded an then splitted by ampersands ("&"). It 
> has to be in
> reverse order, since the payload may contain ampersands, which are 
> URI-encoded by "%26".
> A small working patch for demonstration is attached.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MYFACES-4638) Inputs submitted by AJAX loose all content beginning with ampersand ("&") characters

2023-11-08 Thread Werner Punz (Jira)


[ 
https://issues.apache.org/jira/browse/MYFACES-4638?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17783992#comment-17783992
 ] 

Werner Punz commented on MYFACES-4638:
--

Thanks I will take over this!

 

> Inputs submitted by AJAX loose all content beginning with ampersand ("&") 
> characters
> 
>
> Key: MYFACES-4638
> URL: https://issues.apache.org/jira/browse/MYFACES-4638
> Project: MyFaces Core
>  Issue Type: Bug
>Affects Versions: 4.0.0, 5.0.0
>Reporter: Andreas Osterburg
>Assignee: Werner Punz
>Priority: Major
> Fix For: 4.0.2, 4.1.0, 5.0.0
>
> Attachments: patch-FileUtils.txt, test.xhtml
>
>
> When submitting input fields with AJAX the ampersand "&" character is not 
> handled properly on client side.
> A test case ist attached. Just submitting the form works as expected, 
> submitting by AJAX
> fails if input contains "&"-signs, like "foo".
> It tracked this down to the function _decodeEncodedValues_ in 
> {_}FileUtils.ts{_}. There happens a
> decode of the current ViewState in URI-encoded format.
> Basically the source of the issue is that the input string (in 
> "{_}encoded"){_} is processed in wrong order.
> Currently it is first URI-decoded an then splitted by ampersands ("&"). It 
> has to be in
> reverse order, since the payload may contain ampersands, which are 
> URI-encoded by "%26".
> A small working patch for demonstration is attached.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)