mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-12 15:21:40 +09:00
Ensure proper handling of network shares and URLs in cleanPath()
This commit is contained in:
parent
8773b15410
commit
ff0df0a14b
2 changed files with 22 additions and 2 deletions
|
|
@ -56,6 +56,11 @@ class FilenameFilterTest extends \Codeception\TestCase\Test
|
|||
|
||||
// Test Windows paths.
|
||||
$this->assertEquals('C:/Windows/Notepad.exe', FilenameFilter::cleanPath('C:\\Windows\\System32\\..\\Notepad.exe'));
|
||||
$this->assertEquals('//vboxsrv/hello/world', FilenameFilter::cleanPath('\\\\vboxsrv\\hello\\world'));
|
||||
|
||||
// Test absolute URLs.
|
||||
$this->assertEquals('https://www.rhymix.org/foo/bar', FilenameFilter::cleanPath('https://www.rhymix.org/foo/.//bar'));
|
||||
$this->assertEquals('//www.rhymix.org/foo/bar', FilenameFilter::cleanPath('//www.rhymix.org/foo/.//bar'));
|
||||
|
||||
// Do not remove .. if there is no parent directory.
|
||||
$this->assertEquals('C:/../foobar', FilenameFilter::cleanPath('C:\\..\foobar\\'));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue