[
https://issues.apache.org/jira/browse/WW-5423?focusedWorklogId=922070&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-922070
]
ASF GitHub Bot logged work on WW-5423:
--------------------------------------
Author: ASF GitHub Bot
Created on: 05/Jun/24 05:14
Start Date: 05/Jun/24 05:14
Worklog Time Spent: 10m
Work Description: sonarcloud[bot] commented on PR #954:
URL: https://github.com/apache/struts/pull/954#issuecomment-2148872114
## [](https://sonarcloud.io/dashboard?id=apache_struts&pullRequest=954)
**Quality Gate passed**
Issues
 [0 New
issues](https://sonarcloud.io/project/issues?id=apache_struts&pullRequest=954&resolved=false&sinceLeakPeriod=true)
 [0 Accepted
issues](https://sonarcloud.io/project/issues?id=apache_struts&pullRequest=954&resolutions=WONTFIX)
Measures
 [0 Security
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_struts&pullRequest=954&resolved=false&sinceLeakPeriod=true)
 [100.0% Coverage on New
Code](https://sonarcloud.io/component_measures?id=apache_struts&pullRequest=954&metric=new_coverage&view=list)
 [0.0% Duplication on New
Code](https://sonarcloud.io/component_measures?id=apache_struts&pullRequest=954&metric=new_duplicated_lines_density&view=list)
[See analysis details on
SonarCloud](https://sonarcloud.io/dashboard?id=apache_struts&pullRequest=954)
Issue Time Tracking
-------------------
Worklog Id: (was: 922070)
Time Spent: 0.5h (was: 20m)
> Query Parameters in Multipart Requests not working in v7 M6
> -----------------------------------------------------------
>
> Key: WW-5423
> URL: https://issues.apache.org/jira/browse/WW-5423
> Project: Struts 2
> Issue Type: Bug
> Affects Versions: 7.0.0
> Reporter: Philip Crider
> Priority: Major
> Fix For: 7.0.0
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> One of the changes in [https://github.com/apache/struts/pull/861] broke query
> parameters in multipart requests. Their values are being lost.
> This is the old implementation, which returns null if the parameter doesn't
> exist.
> {code:java}
> public String[] getParameterValues(String name) {
> List<String> v = params.get(name);
> if (v != null && !v.isEmpty()) {
> return v.toArray(new String[0]);
> }
> return null;
> } {code}
>
> And this is the new implementation, which returns an empty array in that case.
> {code:java}
> public String[] getParameterValues(String name) {
> return parameters.getOrDefault(name, Collections.emptyList())
> .toArray(String[]::new);
> }{code}
>
> This method in MultiPartRequestWrapper is expecting null to be returned in
> that case.
> {code:java}
> public String[] getParameterValues(String name) {
> return ((multi == null) || (multi.getParameterValues(name) == null)) ?
> super.getParameterValues(name) : multi.getParameterValues(name);
> }{code}
>
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)