Merge pull request #19704 from owncloud/fix_17997
also detect files in a .part folder as part file
This commit is contained in:
commit
8a35034b4c
2 changed files with 27 additions and 0 deletions
4
lib/private/files/cache/scanner.php
vendored
4
lib/private/files/cache/scanner.php
vendored
|
@ -408,6 +408,10 @@ class Scanner extends BasicEmitter {
|
|||
if (pathinfo($file, PATHINFO_EXTENSION) === 'part') {
|
||||
return true;
|
||||
}
|
||||
if (strpos($file, '.part/') !== false) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
23
tests/lib/files/cache/scanner.php
vendored
23
tests/lib/files/cache/scanner.php
vendored
|
@ -284,4 +284,27 @@ class Scanner extends \Test\TestCase {
|
|||
$cachedData = $this->cache->get('folder/bar.txt');
|
||||
$this->assertEquals($newFolderId, $cachedData['parent']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider dataTestIsPartialFile
|
||||
*
|
||||
* @param string $path
|
||||
* @param bool $expected
|
||||
*/
|
||||
public function testIsPartialFile($path, $expected) {
|
||||
$this->assertSame($expected,
|
||||
$this->scanner->isPartialFile($path)
|
||||
);
|
||||
}
|
||||
|
||||
public function dataTestIsPartialFile() {
|
||||
return [
|
||||
['foo.txt.part', true],
|
||||
['/sub/folder/foo.txt.part', true],
|
||||
['/sub/folder.part/foo.txt', true],
|
||||
['foo.txt', false],
|
||||
['/sub/folder/foo.txt', false],
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue