diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-09-12 10:03:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-12 10:03:29 +0200 |
commit | cb6178b82888c46ad98f45b6b365bb2996c322d1 (patch) | |
tree | 18470cad09c42ad7a7bd79e249786ab86b417554 | |
parent | c1690da20b235a968e4fef58f51e3fadc154e661 (diff) | |
parent | d25ea6ae1cf6c030429df41f85d1b8037a106117 (diff) | |
download | nextcloud-server-cb6178b82888c46ad98f45b6b365bb2996c322d1.tar.gz nextcloud-server-cb6178b82888c46ad98f45b6b365bb2996c322d1.zip |
Merge pull request #6443 from nextcloud/backport-6064-absolute-path-must-be-relative-to-files-on-theming-update
[stable12] Still throw a locked exception when the path is not relative to $user/files/
-rw-r--r-- | lib/private/Files/View.php | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index bc16511bdab..da1c67471ab 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -1950,11 +1950,18 @@ class View { ); } } catch (\OCP\Lock\LockedException $e) { - // rethrow with the a human-readable path - throw new \OCP\Lock\LockedException( - $this->getPathRelativeToFiles($absolutePath), - $e - ); + try { + // rethrow with the a human-readable path + throw new \OCP\Lock\LockedException( + $this->getPathRelativeToFiles($absolutePath), + $e + ); + } catch (\InvalidArgumentException $e) { + throw new \OCP\Lock\LockedException( + $absolutePath, + $e + ); + } } } @@ -2059,7 +2066,7 @@ class View { return ($pathSegments[2] === 'files') && (count($pathSegments) > 3); } - return true; + return strpos($path, '/appdata_') !== 0; } /** |