diff options
Diffstat (limited to 'apps/files/lib')
-rw-r--r-- | apps/files/lib/app.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/apps/files/lib/app.php b/apps/files/lib/app.php index d80024f2470..5bd8c127586 100644 --- a/apps/files/lib/app.php +++ b/apps/files/lib/app.php @@ -74,6 +74,17 @@ class App { 'data' => NULL ); + try { + // check if the new name is conform to file name restrictions + $this->view->verifyPath($dir, $newname); + } catch (\OCP\Files\InvalidPathException $ex) { + $result['data'] = array( + 'message' => $this->l10n->t($ex->getMessage()), + 'code' => 'invalidname', + ); + return $result; + } + $normalizedOldPath = \OC\Files\Filesystem::normalizePath($dir . '/' . $oldname); $normalizedNewPath = \OC\Files\Filesystem::normalizePath($dir . '/' . $newname); |