diff options
author | Lukas Reschke <lukas@owncloud.com> | 2015-02-06 15:03:29 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2015-02-06 15:03:29 +0100 |
commit | 4d91fa4c93aa88480a52eed40fe65d7fdd4912d4 (patch) | |
tree | 6c3a8b06122c8743fa1cd84e6aeda01fc023a758 /tests/lib/files/filesystem.php | |
parent | 80e38b84dccde44c40109e9721fac00984f43ef7 (diff) | |
download | nextcloud-server-4d91fa4c93aa88480a52eed40fe65d7fdd4912d4.tar.gz nextcloud-server-4d91fa4c93aa88480a52eed40fe65d7fdd4912d4.zip |
Normalize before processing
Diffstat (limited to 'tests/lib/files/filesystem.php')
-rw-r--r-- | tests/lib/files/filesystem.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/lib/files/filesystem.php b/tests/lib/files/filesystem.php index 888690adb0e..7bf59315d77 100644 --- a/tests/lib/files/filesystem.php +++ b/tests/lib/files/filesystem.php @@ -187,6 +187,28 @@ class Filesystem extends \Test\TestCase { $this->assertSame($expected, \OC\Files\Filesystem::isValidPath($path)); } + public function isFileBlacklistedData() { + return array( + array('/etc/foo/bar/foo.txt', false), + array('\etc\foo/bar\foo.txt', false), + array('.htaccess', true), + array('.htaccess/', true), + array('.htaccess\\', true), + array('/etc/foo\bar/.htaccess\\', true), + array('/etc/foo\bar/.htaccess/', true), + array('/etc/foo\bar/.htaccess/foo', false), + array('//foo//bar/\.htaccess/', true), + array('\foo\bar\.HTAccess', true), + ); + } + + /** + * @dataProvider isFileBlacklistedData + */ + public function testIsFileBlacklisted($path, $expected) { + $this->assertSame($expected, \OC\Files\Filesystem::isFileBlacklisted($path)); + } + public function normalizePathWindowsAbsolutePathData() { return array( array('C:/', 'C:\\'), |