mirror of
https://github.com/nextcloud/server.git
synced 2026-04-21 14:23:17 -04:00
Merge pull request #34994 from Glandos/fileinfo_perf
[Performance] Test valid path only if file info has to be retrieved
This commit is contained in:
commit
9d45845d2a
1 changed files with 3 additions and 3 deletions
|
|
@ -99,10 +99,10 @@ class Node implements \OCP\Files\Node {
|
|||
* @throws NotFoundException
|
||||
*/
|
||||
public function getFileInfo() {
|
||||
if (!Filesystem::isValidPath($this->path)) {
|
||||
throw new InvalidPathException();
|
||||
}
|
||||
if (!$this->fileInfo) {
|
||||
if (!Filesystem::isValidPath($this->path)) {
|
||||
throw new InvalidPathException();
|
||||
}
|
||||
$fileInfo = $this->view->getFileInfo($this->path);
|
||||
if ($fileInfo instanceof FileInfo) {
|
||||
$this->fileInfo = $fileInfo;
|
||||
|
|
|
|||
Loading…
Reference in a new issue