mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-06-02 22:54:11 +00:00
Requested changes to logic behind ... in file path.
This commit is contained in:
parent
0d5397db34
commit
6aa4a385a3
@ -740,6 +740,7 @@ public class FileSystem
|
|||||||
return sanitizePath( path, false );
|
return sanitizePath( path, false );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final Pattern threeDotsPattern = Pattern.compile( "^\\.{3,}$" );
|
||||||
private static String sanitizePath( String path, boolean allowWildcards )
|
private static String sanitizePath( String path, boolean allowWildcards )
|
||||||
{
|
{
|
||||||
// Allow windowsy slashes
|
// Allow windowsy slashes
|
||||||
@ -765,7 +766,7 @@ public class FileSystem
|
|||||||
Stack<String> outputParts = new Stack<String>();
|
Stack<String> outputParts = new Stack<String>();
|
||||||
for( String part : parts )
|
for( String part : parts )
|
||||||
{
|
{
|
||||||
if( part.length() == 0 || part.equals( "." ) || part.matches( "^\\.{3,}$" ) )
|
if( part.length() == 0 || part.equals( "." ) || threeDotsPattern.matcher( part ).matches() )
|
||||||
{
|
{
|
||||||
// . is redundant
|
// . is redundant
|
||||||
// ... and more are treated as .
|
// ... and more are treated as .
|
||||||
|
Loading…
x
Reference in New Issue
Block a user