Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
79b65269
Commit
79b65269
authored
11 years ago
by
Thomas Müller
Browse files
Options
Downloads
Plain Diff
Merge pull request #8877 from owncloud/getpath-storage-check
Verify that we have a valid storage in View->getPath
parents
1745fe16
d359765b
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/private/files/view.php
+12
-8
12 additions, 8 deletions
lib/private/files/view.php
with
12 additions
and
8 deletions
lib/private/files/view.php
+
12
−
8
View file @
79b65269
...
...
@@ -359,7 +359,8 @@ class View {
$absolutePath
=
Filesystem
::
normalizePath
(
$this
->
getAbsolutePath
(
$path
));
list
(
$storage
,
$internalPath
)
=
Filesystem
::
resolvePath
(
$absolutePath
.
$postFix
);
if
(
!
(
$storage
instanceof
\OC\Files\Storage\Shared
)
&&
(
!
$internalPath
||
$internalPath
===
''
||
$internalPath
===
'/'
))
{
(
!
$internalPath
||
$internalPath
===
''
||
$internalPath
===
'/'
)
)
{
// do not allow deleting the storage's root / the mount point
// because for some storages it might delete the whole contents
// but isn't supposed to work that way
...
...
@@ -678,6 +679,7 @@ class View {
/**
* abstraction layer for basic filesystem functions: wrapper for \OC\Files\Storage\Storage
*
* @param string $operation
* @param string $path
* @param array $hooks (optional)
...
...
@@ -1125,7 +1127,7 @@ class View {
* Note that the resulting path is not guarantied to be unique for the id, multiple paths can point to the same file
*
* @param int $id
* @return string
* @return string
|null
*/
public
function
getPath
(
$id
)
{
$manager
=
Filesystem
::
getMountManager
();
...
...
@@ -1138,6 +1140,7 @@ class View {
/**
* @var \OC\Files\Mount\Mount $mount
*/
if
(
$mount
->
getStorage
())
{
$cache
=
$mount
->
getStorage
()
->
getCache
();
$internalPath
=
$cache
->
getPathById
(
$id
);
if
(
is_string
(
$internalPath
))
{
...
...
@@ -1147,6 +1150,7 @@ class View {
}
}
}
}
return
null
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment