[ 
https://issues.apache.org/jira/browse/WW-5840?focusedWorklogId=1058270&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1058270
 ]

ASF GitHub Bot logged work on WW-5840:
--------------------------------------

                Author: ASF GitHub Bot
            Created on: 02/Dec/26 19:25
            Start Date: 02/Dec/26 19:25
    Worklog Time Spent: 10m 
      Work Description: lukaszlenart commented on PR #2116:
URL: https://github.com/apache/struts/pull/2116#issuecomment-7356148410

   A few more points on the Javadoc and test, adding to my earlier review:
   
   5. **Drive prefixes aren't stripped.** `FilenameUtils.getName` splits only 
on `/` and `\`, so `getName("C:evil.csv")` returns `C:evil.csv` unchanged 
(checked against commons-io 2.22.0). Please drop "directory/drive component" 
and describe the result as "the last path segment of `getOriginalName()`".
   
   6. **Nothing is being restored.** `MultiPartRequest#getFileNames(String)` 
and `AbstractMultiPartRequest#getCanonicalName()` are still there, and the new 
test calls `getFileNames` as its control. Please remove the "Restores ... 
pre-7.0" sentence. If the history is useful, the PR description is the right 
place for it.
   
   7. **Wording.** Please keep the Javadoc and test comments to what the method 
returns: no "Fix:", no "traversal attempt", no "untrusted input". Something 
like this is enough:
   
      ```java
      /**
       * @return {@link #getOriginalName()} without its directory part, as 
returned by
       *         {@code FilenameUtils.getName}; may be empty
       * @since 7.6.0
       */
      ```
   
      A short test name such as `sanitizedOriginalNameDropsDirectoryPart` would 
also fit better than the current narration.
   




Issue Time Tracking
-------------------

    Worklog Id:     (was: 1058270)
    Time Spent: 20m  (was: 10m)

> Provide a path-stripped original file name for action-based file uploads
> ------------------------------------------------------------------------
>
>                 Key: WW-5840
>                 URL: https://issues.apache.org/jira/browse/WW-5840
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Lukasz Lenart
>            Priority: Major
>             Fix For: 7.6.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to