normalize path before comparison to make sure that we always find the mount point
This commit is contained in:
parent
1a3e698294
commit
706a8ace58
|
@ -1493,10 +1493,11 @@ class Util {
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function isSystemWideMountPoint($path) {
|
public function isSystemWideMountPoint($path) {
|
||||||
|
$normalizedPath = ltrim($path, '/');
|
||||||
if (\OCP\App::isEnabled("files_external")) {
|
if (\OCP\App::isEnabled("files_external")) {
|
||||||
$mount = \OC_Mount_Config::getSystemMountPoints();
|
$mount = \OC_Mount_Config::getSystemMountPoints();
|
||||||
foreach ($mount as $mountPoint => $data) {
|
foreach ($mount as $mountPoint => $data) {
|
||||||
if ($mountPoint == substr($path, 1, strlen($mountPoint))) {
|
if ($mountPoint == substr($normalizedPath, 0, strlen($mountPoint))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue