You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2022/09/12 08:08:00 UTC
[jira] [Work logged] (IO-611) FilenameUtils.normalize does not sanitize multiple slashes after prefix
[ https://issues.apache.org/jira/browse/IO-611?focusedWorklogId=807808&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-807808 ]
ASF GitHub Bot logged work on IO-611:
-------------------------------------
Author: ASF GitHub Bot
Created on: 12/Sep/22 08:07
Start Date: 12/Sep/22 08:07
Worklog Time Spent: 10m
Work Description: urvanov-ru opened a new pull request, #383:
URL: https://github.com/apache/commons-io/pull/383
Looks like someone fixed the code, but javadoc describes the method wrong.
Issue Time Tracking
-------------------
Worklog Id: (was: 807808)
Remaining Estimate: 0h
Time Spent: 10m
> FilenameUtils.normalize does not sanitize multiple slashes after prefix
> -----------------------------------------------------------------------
>
> Key: IO-611
> URL: https://issues.apache.org/jira/browse/IO-611
> Project: Commons IO
> Issue Type: Bug
> Affects Versions: 2.6
> Reporter: Urvanov
> Priority: Major
> Time Spent: 10m
> Remaining Estimate: 0h
>
> FilenameUtils.#normalize states in javadoc that //foo//./bar becomes /foo/bar
> {code:java}
> System.out.println(FilenameUtils.normalize("//foo//./bar"));
> System.out.println(FilenameUtils.normalize("\\\\foo\\\\.\\bar"));
> {code}
> Result:
> {code:java}
> //foo//bar
> //foo//bar
> {code}
> So, javadoc says, that it should be /foo/bar. I think, that //foo is prefix, so it should be //foo/bar. But in real life it becomes the third way (//foo//bar).
>
> I think we should fix javadoc and the code. The correct result should be //foo/bar
--
This message was sent by Atlassian Jira
(v8.20.10#820010)