-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Paths added to messages and message cleanup #33061
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
9eb1a92
Paths added to messages and message cleanup
pboguslawski 04baf69
Update lib/private/Files/Node/Folder.php
pboguslawski 097b785
Update Folder.php
pboguslawski a850424
Update Folder.php
pboguslawski 4a46c74
Merge master
pboguslawski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| <?php | ||
| /** | ||
| * @copyright Copyright (c) 2016, ownCloud, Inc. | ||
| * @copyright Copyright (c) 2022 Informatyka Boguslawski sp. z o.o. sp.k., http://www.ib.pl/ | ||
pboguslawski marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| * | ||
| * @author Arthur Schiwon <[email protected]> | ||
| * @author Christoph Wurst <[email protected]> | ||
|
|
@@ -67,7 +68,7 @@ protected function createNonExistingNode($path) { | |
| */ | ||
| public function getFullPath($path) { | ||
| if (!$this->isValidPath($path)) { | ||
| throw new NotPermittedException('Invalid path'); | ||
| throw new NotPermittedException('Invalid path "' . $path . '"'); | ||
| } | ||
| return $this->path . $this->normalizePath($path); | ||
| } | ||
|
|
@@ -162,14 +163,14 @@ public function newFolder($path) { | |
| $nonExisting = new NonExistingFolder($this->root, $this->view, $fullPath); | ||
| $this->sendHooks(['preWrite', 'preCreate'], [$nonExisting]); | ||
| if (!$this->view->mkdir($fullPath)) { | ||
| throw new NotPermittedException('Could not create folder'); | ||
| throw new NotPermittedException('Could not create folder "' . $fullPath . '"'); | ||
| } | ||
| $parent = dirname($fullPath) === $this->getPath() ? $this : null; | ||
| $node = new Folder($this->root, $this->view, $fullPath, null, $parent); | ||
| $this->sendHooks(['postWrite', 'postCreate'], [$node]); | ||
| return $node; | ||
| } else { | ||
| throw new NotPermittedException('No create permission for folder'); | ||
| throw new NotPermittedException('No create permission for folder "' . $path . '"'); | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -193,13 +194,13 @@ public function newFile($path, $content = null) { | |
| $result = $this->view->touch($fullPath); | ||
| } | ||
| if ($result === false) { | ||
| throw new NotPermittedException('Could not create path'); | ||
| throw new NotPermittedException('Could not create path "' . $fullPath . '"'); | ||
| } | ||
| $node = new File($this->root, $this->view, $fullPath, null, $this); | ||
| $this->sendHooks(['postWrite', 'postCreate'], [$node]); | ||
| return $node; | ||
| } | ||
| throw new NotPermittedException('No create permission for path'); | ||
| throw new NotPermittedException('No create permission for path "' . $path . '"'); | ||
| } | ||
|
|
||
| private function queryFromOperator(ISearchOperator $operator, string $uid = null): ISearchQuery { | ||
|
|
@@ -229,7 +230,7 @@ public function search($query) { | |
|
|
||
| $limitToHome = $query->limitToHome(); | ||
| if ($limitToHome && count(explode('/', $this->path)) !== 3) { | ||
| throw new \InvalidArgumentException('searching by owner is only allows on the users home folder'); | ||
| throw new \InvalidArgumentException('searching by owner is only allowed in the users home folder'); | ||
| } | ||
|
|
||
| $rootLength = strlen($this->path); | ||
|
|
@@ -391,7 +392,7 @@ public function delete() { | |
| $nonExisting = new NonExistingFolder($this->root, $this->view, $this->path, $fileInfo); | ||
| $this->sendHooks(['postDelete'], [$nonExisting]); | ||
| } else { | ||
| throw new NotPermittedException('No delete permission for path'); | ||
| throw new NotPermittedException('No delete permission for path "' . $this->path . '"'); | ||
| } | ||
| } | ||
|
|
||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.