[
https://issues.apache.org/jira/browse/WW-5871?focusedWorklogId=1056506&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1056506
]
ASF GitHub Bot logged work on WW-5871:
--------------------------------------
Author: ASF GitHub Bot
Created on: 22/Nov/26 13:56
Start Date: 22/Nov/26 13:56
Worklog Time Spent: 10m
Work Description: sonarqubecloud[bot] commented on PR #2154:
URL: https://github.com/apache/struts/pull/2154#issuecomment-7080177339
## [](https://sonarcloud.io/dashboard?id=apache_struts&pullRequest=2154)
**Quality Gate passed**
Issues
 [0 New
issues](https://sonarcloud.io/project/issues?id=apache_struts&pullRequest=2154&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted
issues](https://sonarcloud.io/project/issues?id=apache_struts&pullRequest=2154&issueStatuses=ACCEPTED)
Measures
 [0 Security
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_struts&pullRequest=2154&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [100.0% Coverage on New
Code](https://sonarcloud.io/component_measures?id=apache_struts&pullRequest=2154&metric=new_coverage&view=list)
 [0.0% Duplication on New
Code](https://sonarcloud.io/component_measures?id=apache_struts&pullRequest=2154&metric=new_duplicated_lines_density&view=list)
<!
Issue Time Tracking
-------------------
Worklog Id: (was: 1056506)
Time Spent: 20m (was: 10m)
> Request parameters bound to String properties are trimmed since 7.5.0
> ---------------------------------------------------------------------
>
> Key: WW-5871
> URL: https://issues.apache.org/jira/browse/WW-5871
> Project: Struts 2
> Issue Type: Bug
> Components: Core
> Affects Versions: 7.5.0
> Reporter: Lukasz Lenart
> Priority: Major
> Fix For: 7.6.0
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> WW-3666 trims surrounding whitespace before converting a value to a
> non-String type, and String targets are meant to keep the raw value. Since
> 7.5.0, however, a request parameter bound to a String property is trimmed too.
> A request parameter reaches {{XWorkBasicConverter.convertValue}} as a
> {{String[]}}. The early return skips conversion only when the value's class
> already matches the target type, so a {{String[]}} passes it. The trim step
> then trims every element, because it excludes arrays, collections and
> Character targets but not String, and the trimmed element is converted to
> String.
> {code:java}
> converter.convertValue(context, null, null, null, new String[]{" summer2026
> "}, String.class);
> // 7.4.0: " summer2026 "
> // 7.5.0: "summer2026"
> converter.convertValue(context, null, null, null, " summer2026 ",
> String.class);
> // " summer2026 " on both - the early return covers a bare String
> {code}
> The test added with WW-3666 covers only the bare String case, which never
> reaches the trim.
> Impact: any String property loses leading and trailing whitespace, for
> example a password that starts or ends with a space no longer matches after
> the upgrade.
> Reported on the user list.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)