Parcourir la source

Properly search the root of a shared external storage

Fixes #1020

When an external storage is shared with you in full the root is ''
(empty). This adds an extra check for an empty jail basically.

Because if the jail is on the empty string. It matches all paths.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
tags/v15.0.0beta1
Roeland Jago Douma il y a 5 ans
Parent
révision
0277cd7158
Aucun compte lié à l'adresse e-mail de l'auteur
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1
    1
      lib/private/Files/Cache/Wrapper/CacheJail.php

+ 1
- 1
lib/private/Files/Cache/Wrapper/CacheJail.php Voir le fichier

@@ -94,7 +94,7 @@ class CacheJail extends CacheWrapper {

protected function filterCacheEntry($entry) {
$rootLength = strlen($this->getRoot()) + 1;
return ($entry['path'] === $this->getRoot()) or (substr($entry['path'], 0, $rootLength) === $this->getRoot() . '/');
return $rootLength === 1 || ($entry['path'] === $this->getRoot()) || (substr($entry['path'], 0, $rootLength) === $this->getRoot() . '/');
}

/**

Chargement…
Annuler
Enregistrer