Explorar el Código

Merge pull request #44203 from nextcloud/fix/scandir-nx-directory

fix: avoid scanning a non existing directory
tags/v29.0.0beta3
Ferdinand Thiessen hace 3 meses
padre
commit
937b7467f1
No account linked to committer's email address
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  1. 5
    1
      lib/private/Files/Storage/Local.php

+ 5
- 1
lib/private/Files/Storage/Local.php Ver fichero

@@ -282,7 +282,11 @@ class Local extends \OC\Files\Storage\Common {
public function file_exists($path) {
if ($this->caseInsensitive) {
$fullPath = $this->getSourcePath($path);
$content = scandir(dirname($fullPath), SCANDIR_SORT_NONE);
$parentPath = dirname($fullPath);
if (!is_dir($parentPath)) {
return false;
}
$content = scandir($parentPath, SCANDIR_SORT_NONE);
return is_array($content) && array_search(basename($fullPath), $content) !== false;
} else {
return file_exists($this->getSourcePath($path));

Cargando…
Cancelar
Guardar