Merge pull request #34994 from Glandos/fileinfo_perf

[Performance] Test valid path only if file info has to be retrieved
pull/33631/head
Simon L 3 years ago committed by GitHub
commit 9d45845d2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      lib/private/Files/Node/Node.php

@ -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…
Cancel
Save