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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
fbbc76f2
Commit
fbbc76f2
authored
11 years ago
by
Florin Peter
Browse files
Options
Downloads
Patches
Plain Diff
fix for sharing files
parent
b1c4464e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
apps/files_encryption/lib/proxy.php
+17
-16
17 additions, 16 deletions
apps/files_encryption/lib/proxy.php
with
17 additions
and
16 deletions
apps/files_encryption/lib/proxy.php
+
17
−
16
View file @
fbbc76f2
...
@@ -153,9 +153,9 @@ class Proxy extends \OC_FileProxy {
...
@@ -153,9 +153,9 @@ class Proxy extends \OC_FileProxy {
$data
=
$encData
;
$data
=
$encData
;
// Update the file cache with file info
// Update the file cache with file info
\OC\Files\Filesystem
::
putFileInfo
(
$
p
ath
,
array
(
'encrypted'
=>
true
,
'size'
=>
$size
),
''
);
\OC\Files\Filesystem
::
putFileInfo
(
$
fileP
ath
,
array
(
'encrypted'
=>
true
,
'size'
=>
strlen
(
$size
),
'unencrypted_size'
=>
$size
),
''
);
// Re-enable proxy - our work is done
// Re-enable proxy - our work is done
\OC_FileProxy
::
$enabled
=
$proxyStatus
;
\OC_FileProxy
::
$enabled
=
$proxyStatus
;
}
}
...
@@ -437,24 +437,25 @@ class Proxy extends \OC_FileProxy {
...
@@ -437,24 +437,25 @@ class Proxy extends \OC_FileProxy {
$fileInfo
=
\OC\Files\Filesystem
::
getFileInfo
(
$path_f
);
$fileInfo
=
\OC\Files\Filesystem
::
getFileInfo
(
$path_f
);
// if file is encrypted return real file size
// if file is encrypted return real file size
if
(
is_array
(
$fileInfo
)
&&
$fileInfo
[
'encrypted'
]
==
1
)
{
if
(
is_array
(
$fileInfo
)
&&
$fileInfo
[
'encrypted'
]
==
=
true
)
{
$size
=
$fileInfo
[
'unencrypted_size'
];
$size
=
$fileInfo
[
'unencrypted_size'
];
}
else
{
}
else
{
// self healing if file was removed from file cache
// self healing if file was removed from file cache
$userId
=
\OCP\User
::
getUser
();
if
(
is_array
(
$fileInfo
))
{
$util
=
new
Util
(
$view
,
$userId
);
$userId
=
\OCP\User
::
getUser
();
$fixSize
=
$util
->
getFileSize
(
$path
);
$util
=
new
Util
(
$view
,
$userId
);
if
(
$fixSize
>
0
)
{
$fixSize
=
$util
->
getFileSize
(
$path
);
$size
=
$fixSize
;
if
(
$fixSize
>
0
)
{
$size
=
$fixSize
;
$fileInfo
[
'encrypted'
]
=
1
;
$fileInfo
[
'unencrypted_size'
]
=
$size
;
$fileInfo
[
'encrypted'
]
=
1
;
$fileInfo
[
'unencrypted_size'
]
=
$size
;
// put file info
$view
->
putFileInfo
(
$path
,
$fileInfo
);
// put file info
$view
->
putFileInfo
(
$path_f
,
$fileInfo
);
}
}
}
}
}
return
$size
;
return
$size
;
}
}
...
...
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