diff options
author | Julius Härtl <jus@bitgrid.net> | 2020-05-20 17:15:05 +0300 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2020-05-20 17:17:07 +0300 |
commit | 80160fbe8d7b5dc4f6061530e158ac5342f8d0ad (patch) | |
tree | f35b7656ed053b4bf1984fb8c5fcdb9f8e98c812 /lib | |
parent | 4a1f23a5b798e5bfb5b41870ea07d17d856051e9 (diff) |
Be more robust on paths that don't start with a slash
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Controller/OCSController.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Controller/OCSController.php b/lib/Controller/OCSController.php index 8574ffb7..0d436c44 100644 --- a/lib/Controller/OCSController.php +++ b/lib/Controller/OCSController.php @@ -173,7 +173,7 @@ class OCSController extends \OCP\AppFramework\OCSController { private function mb_pathinfo($filepath) { $result = []; - preg_match('%^(.*?)[\\\\/]*(([^/\\\\]*?)(\.([^\.\\\\/]+?)|))[\\\\/\.]*$%im',$filepath,$matches); + preg_match('%^(.*?)[\\\\/]*(([^/\\\\]*?)(\.([^\.\\\\/]+?)|))[\\\\/\.]*$%im', ltrim('/' . $filepath), $matches); if($matches[1]) { $result['dirname'] = $matches[1]; } |