[jira] [Commented] (WW-5310) s:url does not handle equal sign correctly

2024-06-18 Thread nikos dimitrakas (Jira)


[ 
https://issues.apache.org/jira/browse/WW-5310?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17855959#comment-17855959
 ] 

nikos dimitrakas commented on WW-5310:
--

The new changes together with the changes from Pull Request #692 seem good.

> s:url does not handle equal sign correctly
> --
>
> Key: WW-5310
> URL: https://issues.apache.org/jira/browse/WW-5310
> Project: Struts 2
>  Issue Type: Bug
>  Components: Core Tags
>Affects Versions: 2.5.30, 6.1.2
>Reporter: nikos dimitrakas
>Assignee: Lukasz Lenart
>Priority: Major
> Fix For: 6.5.0
>
>  Time Spent: 2h 50m
>  Remaining Estimate: 0h
>
> We discovered a strange case when a URL is passed to s:url. The URL contains 
> an equal sign as part of a parameter value. Example:
> [https://www.scitepress.org/PublicationsDetail.aspx?ID=GjTu91suYQI=&t=1]
> This URL works in the browser even though the equal sign that is part of the 
> value of the parameter ID has not been replaced with %3D.
> When this URL is passed to an s:url as value then the equal sign disappears. 
> When I put a break point in ComponentTagSupport.doStartTag() I can see that 
> the query string has been split and the component.parameters contains the two 
> parameters (ID and t), but the equal sign is missing. 
> The problem seems to be in ServletUrlRenderer.mergeRequestParameters called 
> from beforeRenderUrl. The way the StrutsQueryStringParser.parse splits each 
> param of the queryString on equal sign causes all the equal signs to be used, 
> not just the first. Shouldn't that split be only on the first equal sign so 
> that any remaining equal signs can be considered as part of the value? Just 
> by adding a limit of one to the split should fix this.



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


[jira] [Commented] (WW-5310) s:url does not handle equal sign correctly

2024-06-18 Thread Lukasz Lenart (Jira)


[ 
https://issues.apache.org/jira/browse/WW-5310?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17855818#comment-17855818
 ] 

Lukasz Lenart commented on WW-5310:
---

[~nikos] could you review this [GitHub Pull Request 
#968|https://github.com/apache/struts/pull/968]?

> s:url does not handle equal sign correctly
> --
>
> Key: WW-5310
> URL: https://issues.apache.org/jira/browse/WW-5310
> Project: Struts 2
>  Issue Type: Bug
>  Components: Core Tags
>Affects Versions: 2.5.30, 6.1.2
>Reporter: nikos dimitrakas
>Priority: Major
> Fix For: 6.5.0
>
>  Time Spent: 2h 40m
>  Remaining Estimate: 0h
>
> We discovered a strange case when a URL is passed to s:url. The URL contains 
> an equal sign as part of a parameter value. Example:
> [https://www.scitepress.org/PublicationsDetail.aspx?ID=GjTu91suYQI=&t=1]
> This URL works in the browser even though the equal sign that is part of the 
> value of the parameter ID has not been replaced with %3D.
> When this URL is passed to an s:url as value then the equal sign disappears. 
> When I put a break point in ComponentTagSupport.doStartTag() I can see that 
> the query string has been split and the component.parameters contains the two 
> parameters (ID and t), but the equal sign is missing. 
> The problem seems to be in ServletUrlRenderer.mergeRequestParameters called 
> from beforeRenderUrl. The way the StrutsQueryStringParser.parse splits each 
> param of the queryString on equal sign causes all the equal signs to be used, 
> not just the first. Shouldn't that split be only on the first equal sign so 
> that any remaining equal signs can be considered as part of the value? Just 
> by adding a limit of one to the split should fix this.



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


[jira] [Commented] (WW-5310) s:url does not handle equal sign correctly

2023-09-05 Thread nikos dimitrakas (Jira)


[ 
https://issues.apache.org/jira/browse/WW-5310?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17762145#comment-17762145
 ] 

nikos dimitrakas commented on WW-5310:
--

I also noticed that the fragment identifier remains as part of the _value if no 
? exists, so the behaviour is different if there is both a query string and a 
fragment identifier or if there is only a fragment identifier. This causes also 
the weird behaviour that if the value of an s:url has a fragment identifier and 
also specifies nested s:param-tags, the parameters are added after the fragment 
identifier and thus become part of the fragment identifier, not part of the 
query string. Sure, this is a very unlikely scenario, but still.

> s:url does not handle equal sign correctly
> --
>
> Key: WW-5310
> URL: https://issues.apache.org/jira/browse/WW-5310
> Project: Struts 2
>  Issue Type: Bug
>  Components: Core Tags
>Affects Versions: 2.5.30, 6.1.2
>Reporter: nikos dimitrakas
>Priority: Major
> Fix For: 6.2.0
>
>  Time Spent: 2.5h
>  Remaining Estimate: 0h
>
> We discovered a strange case when a URL is passed to s:url. The URL contains 
> an equal sign as part of a parameter value. Example:
> [https://www.scitepress.org/PublicationsDetail.aspx?ID=GjTu91suYQI=&t=1]
> This URL works in the browser even though the equal sign that is part of the 
> value of the parameter ID has not been replaced with %3D.
> When this URL is passed to an s:url as value then the equal sign disappears. 
> When I put a break point in ComponentTagSupport.doStartTag() I can see that 
> the query string has been split and the component.parameters contains the two 
> parameters (ID and t), but the equal sign is missing. 
> The problem seems to be in ServletUrlRenderer.mergeRequestParameters called 
> from beforeRenderUrl. The way the StrutsQueryStringParser.parse splits each 
> param of the queryString on equal sign causes all the equal signs to be used, 
> not just the first. Shouldn't that split be only on the first equal sign so 
> that any remaining equal signs can be considered as part of the value? Just 
> by adding a limit of one to the split should fix this.



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


[jira] [Commented] (WW-5310) s:url does not handle equal sign correctly

2023-09-05 Thread nikos dimitrakas (Jira)


[ 
https://issues.apache.org/jira/browse/WW-5310?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17762140#comment-17762140
 ] 

nikos dimitrakas commented on WW-5310:
--

I am trying to upgrade to 6.3.0 from 6.1.2.1 and I see that the fragment 
identifier is completely ignored by the s:url-tag. In the ServletUrlRenderer 
you exclude everything after ? and send to the urlHelper.buildUrl only the 
parameters, not the fragment identifier. Then you only add a new fragment 
identifier to the result if there is an anchor specified. So any fragment 
identifier that what part of the urlComponent's value is ignored. This change 
in behaviour is not backwards compatible. 

> s:url does not handle equal sign correctly
> --
>
> Key: WW-5310
> URL: https://issues.apache.org/jira/browse/WW-5310
> Project: Struts 2
>  Issue Type: Bug
>  Components: Core Tags
>Affects Versions: 2.5.30, 6.1.2
>Reporter: nikos dimitrakas
>Priority: Major
> Fix For: 6.2.0
>
>  Time Spent: 2.5h
>  Remaining Estimate: 0h
>
> We discovered a strange case when a URL is passed to s:url. The URL contains 
> an equal sign as part of a parameter value. Example:
> [https://www.scitepress.org/PublicationsDetail.aspx?ID=GjTu91suYQI=&t=1]
> This URL works in the browser even though the equal sign that is part of the 
> value of the parameter ID has not been replaced with %3D.
> When this URL is passed to an s:url as value then the equal sign disappears. 
> When I put a break point in ComponentTagSupport.doStartTag() I can see that 
> the query string has been split and the component.parameters contains the two 
> parameters (ID and t), but the equal sign is missing. 
> The problem seems to be in ServletUrlRenderer.mergeRequestParameters called 
> from beforeRenderUrl. The way the StrutsQueryStringParser.parse splits each 
> param of the queryString on equal sign causes all the equal signs to be used, 
> not just the first. Shouldn't that split be only on the first equal sign so 
> that any remaining equal signs can be considered as part of the value? Just 
> by adding a limit of one to the split should fix this.



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


[jira] [Commented] (WW-5310) s:url does not handle equal sign correctly

2023-05-29 Thread nikos dimitrakas (Jira)


[ 
https://issues.apache.org/jira/browse/WW-5310?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17727123#comment-17727123
 ] 

nikos dimitrakas commented on WW-5310:
--

Here is an example of a url with a complex fragment:

[http://www.google.se/books?hl=en&lr=&id=UxyXBQAAQBAJ&oi=fnd&pg=PA98&ots=pOt6UqtxNW&sig=oodVicap-mmch-iZpYQIfF3TGwY&redir_esc=y#v=twopage&q&f=false]

And an alternative with the fragment identifier containing escaped characters:

[https://books.google.se/books?hl=en&lr&id=UxyXBQAAQBAJ&oi=fnd&pg=PA98&ots=pOt6UqtxNW&sig=oodVicap-mmch-iZpYQIfF3TGwY&redir_esc=y&pli=1#v=snippet&q=Deng%20%26%20Wang&f=false]

 

> s:url does not handle equal sign correctly
> --
>
> Key: WW-5310
> URL: https://issues.apache.org/jira/browse/WW-5310
> Project: Struts 2
>  Issue Type: Bug
>  Components: Core Tags
>Affects Versions: 2.5.30, 6.1.2
>Reporter: nikos dimitrakas
>Priority: Major
> Fix For: 6.2.0
>
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> We discovered a strange case when a URL is passed to s:url. The URL contains 
> an equal sign as part of a parameter value. Example:
> [https://www.scitepress.org/PublicationsDetail.aspx?ID=GjTu91suYQI=&t=1]
> This URL works in the browser even though the equal sign that is part of the 
> value of the parameter ID has not been replaced with %3D.
> When this URL is passed to an s:url as value then the equal sign disappears. 
> When I put a break point in ComponentTagSupport.doStartTag() I can see that 
> the query string has been split and the component.parameters contains the two 
> parameters (ID and t), but the equal sign is missing. 
> The problem seems to be in ServletUrlRenderer.mergeRequestParameters called 
> from beforeRenderUrl. The way the StrutsQueryStringParser.parse splits each 
> param of the queryString on equal sign causes all the equal signs to be used, 
> not just the first. Shouldn't that split be only on the first equal sign so 
> that any remaining equal signs can be considered as part of the value? Just 
> by adding a limit of one to the split should fix this.



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


[jira] [Commented] (WW-5310) s:url does not handle equal sign correctly

2023-05-29 Thread Lukasz Lenart (Jira)


[ 
https://issues.apache.org/jira/browse/WW-5310?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17727111#comment-17727111
 ] 

Lukasz Lenart commented on WW-5310:
---

I missed that, do you have an example url?

> s:url does not handle equal sign correctly
> --
>
> Key: WW-5310
> URL: https://issues.apache.org/jira/browse/WW-5310
> Project: Struts 2
>  Issue Type: Bug
>  Components: Core Tags
>Affects Versions: 2.5.30, 6.1.2
>Reporter: nikos dimitrakas
>Priority: Major
> Fix For: 6.2.0
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> We discovered a strange case when a URL is passed to s:url. The URL contains 
> an equal sign as part of a parameter value. Example:
> [https://www.scitepress.org/PublicationsDetail.aspx?ID=GjTu91suYQI=&t=1]
> This URL works in the browser even though the equal sign that is part of the 
> value of the parameter ID has not been replaced with %3D.
> When this URL is passed to an s:url as value then the equal sign disappears. 
> When I put a break point in ComponentTagSupport.doStartTag() I can see that 
> the query string has been split and the component.parameters contains the two 
> parameters (ID and t), but the equal sign is missing. 
> The problem seems to be in ServletUrlRenderer.mergeRequestParameters called 
> from beforeRenderUrl. The way the StrutsQueryStringParser.parse splits each 
> param of the queryString on equal sign causes all the equal signs to be used, 
> not just the first. Shouldn't that split be only on the first equal sign so 
> that any remaining equal signs can be considered as part of the value? Just 
> by adding a limit of one to the split should fix this.



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


[jira] [Commented] (WW-5310) s:url does not handle equal sign correctly

2023-05-29 Thread nikos dimitrakas (Jira)


[ 
https://issues.apache.org/jira/browse/WW-5310?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17727060#comment-17727060
 ] 

nikos dimitrakas commented on WW-5310:
--

I was looking at the changes in the PR and I don't see that the problem with 
the fragment identifier has been addressed.

> s:url does not handle equal sign correctly
> --
>
> Key: WW-5310
> URL: https://issues.apache.org/jira/browse/WW-5310
> Project: Struts 2
>  Issue Type: Bug
>  Components: Core Tags
>Affects Versions: 2.5.30, 6.1.2
>Reporter: nikos dimitrakas
>Priority: Major
> Fix For: 6.2.0
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> We discovered a strange case when a URL is passed to s:url. The URL contains 
> an equal sign as part of a parameter value. Example:
> [https://www.scitepress.org/PublicationsDetail.aspx?ID=GjTu91suYQI=&t=1]
> This URL works in the browser even though the equal sign that is part of the 
> value of the parameter ID has not been replaced with %3D.
> When this URL is passed to an s:url as value then the equal sign disappears. 
> When I put a break point in ComponentTagSupport.doStartTag() I can see that 
> the query string has been split and the component.parameters contains the two 
> parameters (ID and t), but the equal sign is missing. 
> The problem seems to be in ServletUrlRenderer.mergeRequestParameters called 
> from beforeRenderUrl. The way the StrutsQueryStringParser.parse splits each 
> param of the queryString on equal sign causes all the equal signs to be used, 
> not just the first. Shouldn't that split be only on the first equal sign so 
> that any remaining equal signs can be considered as part of the value? Just 
> by adding a limit of one to the split should fix this.



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


[jira] [Commented] (WW-5310) s:url does not handle equal sign correctly

2023-05-28 Thread Lukasz Lenart (Jira)


[ 
https://issues.apache.org/jira/browse/WW-5310?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17726893#comment-17726893
 ] 

Lukasz Lenart commented on WW-5310:
---

Not sure why the [PR|https://github.com/apache/struts/pull/689] wasn't linked 
here, but I think the problem is gone.

> s:url does not handle equal sign correctly
> --
>
> Key: WW-5310
> URL: https://issues.apache.org/jira/browse/WW-5310
> Project: Struts 2
>  Issue Type: Bug
>  Components: Core Tags
>Affects Versions: 2.5.30, 6.1.2
>Reporter: nikos dimitrakas
>Priority: Major
> Fix For: 6.2.0
>
>
> We discovered a strange case when a URL is passed to s:url. The URL contains 
> an equal sign as part of a parameter value. Example:
> [https://www.scitepress.org/PublicationsDetail.aspx?ID=GjTu91suYQI=&t=1]
> This URL works in the browser even though the equal sign that is part of the 
> value of the parameter ID has not been replaced with %3D.
> When this URL is passed to an s:url as value then the equal sign disappears. 
> When I put a break point in ComponentTagSupport.doStartTag() I can see that 
> the query string has been split and the component.parameters contains the two 
> parameters (ID and t), but the equal sign is missing. 
> The problem seems to be in ServletUrlRenderer.mergeRequestParameters called 
> from beforeRenderUrl. The way the StrutsQueryStringParser.parse splits each 
> param of the queryString on equal sign causes all the equal signs to be used, 
> not just the first. Shouldn't that split be only on the first equal sign so 
> that any remaining equal signs can be considered as part of the value? Just 
> by adding a limit of one to the split should fix this.



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


[jira] [Commented] (WW-5310) s:url does not handle equal sign correctly

2023-05-11 Thread nikos dimitrakas (Jira)


[ 
https://issues.apache.org/jira/browse/WW-5310?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17721805#comment-17721805
 ] 

nikos dimitrakas commented on WW-5310:
--

There is also a problem with URLs containing a #. When a # is part of the URL, 
it should be treated as the beginning of the fragment identifier and not as 
part of the value of the last parameter of the query string. If a # is supposed 
to be part of the parameter value, then it is encoded as %23.

So perhaps before splitting the query string on &, split it first on # in order 
to get the left part which would be the actual query string. As it is now 
ServetUrlRenderer includes the fragment identifier as part of the query string 
when it sends it to the parser. This should probably be fixed in the 
ServletUrlRenderer so that the sent query string can actually be only the query 
string.

> s:url does not handle equal sign correctly
> --
>
> Key: WW-5310
> URL: https://issues.apache.org/jira/browse/WW-5310
> Project: Struts 2
>  Issue Type: Bug
>  Components: Core Tags
>Affects Versions: 2.5.30, 6.1.2
>Reporter: nikos dimitrakas
>Priority: Major
>
> We discovered a strange case when a URL is passed to s:url. The URL contains 
> an equal sign as part of a parameter value. Example:
> [https://www.scitepress.org/PublicationsDetail.aspx?ID=GjTu91suYQI=&t=1]
> This URL works in the browser even though the equal sign that is part of the 
> value of the parameter ID has not been replaced with %3D.
> When this URL is passed to an s:url as value then the equal sign disappears. 
> When I put a break point in ComponentTagSupport.doStartTag() I can see that 
> the query string has been split and the component.parameters contains the two 
> parameters (ID and t), but the equal sign is missing. 
> The problem seems to be in ServletUrlRenderer.mergeRequestParameters called 
> from beforeRenderUrl. The way the StrutsQueryStringParser.parse splits each 
> param of the queryString on equal sign causes all the equal signs to be used, 
> not just the first. Shouldn't that split be only on the first equal sign so 
> that any remaining equal signs can be considered as part of the value? Just 
> by adding a limit of one to the split should fix this.



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