Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
306
Merge Requests
306
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
706ea3e5
Commit
706ea3e5
authored
Oct 11, 2008
by
webchick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#319341
:
SA-2008
-060 (
#318706
): Access bypass for files attached to restricted nodes.
parent
4748ac2c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
modules/upload/upload.module
modules/upload/upload.module
+8
-6
No files found.
modules/upload/upload.module
View file @
706ea3e5
...
...
@@ -154,15 +154,17 @@ function _upload_file_limits($user) {
*/
function
upload_file_download
(
$filepath
)
{
$filepath
=
file_create_path
(
$filepath
);
$result
=
db_query
(
"SELECT f.* FROM
{
files
}
f INNER JOIN
{
upload
}
u ON f.fid = u.fid WHERE filepath = '%s'"
,
$filepath
);
$result
=
db_query
(
"SELECT f.*
, u.nid
FROM
{
files
}
f INNER JOIN
{
upload
}
u ON f.fid = u.fid WHERE filepath = '%s'"
,
$filepath
);
if
(
$file
=
db_fetch_object
(
$result
))
{
if
(
!
user_access
(
'view uploaded files'
))
{
if
(
user_access
(
'view uploaded files'
)
&&
(
$node
=
node_load
(
$file
->
nid
))
&&
node_access
(
'view'
,
$node
))
{
return
array
(
'Content-Type: '
.
$file
->
filemime
,
'Content-Length: '
.
$file
->
filesize
,
);
}
else
{
return
-
1
;
}
return
array
(
'Content-Type: '
.
$file
->
filemime
,
'Content-Length: '
.
$file
->
filesize
,
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment