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
221
Merge Requests
221
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
afeed9ed
Commit
afeed9ed
authored
Jan 29, 2013
by
webchick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#1890754
by Heine, pwolanin, tim.plunkett, Berdir: Fixed Private Images visible by url.
parent
79941b52
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
core/modules/image/image.module
core/modules/image/image.module
+2
-1
core/modules/image/lib/Drupal/image/Tests/ImageStylesPathAndUrlTest.php
...mage/lib/Drupal/image/Tests/ImageStylesPathAndUrlTest.php
+6
-0
No files found.
core/modules/image/image.module
View file @
afeed9ed
...
...
@@ -301,7 +301,8 @@ function image_file_download($uri) {
if
(
$info
=
image_get_info
(
$uri
))
{
// Check the permissions of the original to grant access to this image.
$headers
=
module_invoke_all
(
'file_download'
,
$original_uri
);
if
(
!
in_array
(
-
1
,
$headers
))
{
// Confirm there's at least one module granting access and none denying access.
if
(
!
empty
(
$headers
)
&&
!
in_array
(
-
1
,
$headers
))
{
return
array
(
// Send headers describing the image's size, and MIME-type...
'Content-Type'
=>
$info
[
'mime_type'
],
...
...
core/modules/image/lib/Drupal/image/Tests/ImageStylesPathAndUrlTest.php
View file @
afeed9ed
...
...
@@ -136,6 +136,12 @@ function _testImageStyleUrlAndPath($scheme, $clean_url = TRUE) {
$this
->
drupalGet
(
$generate_url
);
$this
->
assertResponse
(
200
,
'Image was generated at the URL.'
);
// Make sure that access is denied for existing style files if we do not
// have access.
state
()
->
delete
(
'image.test_file_download'
);
$this
->
drupalGet
(
$generate_url
);
$this
->
assertResponse
(
403
,
'Confirmed that access is denied for the private image style.'
);
// Repeat this with a different file that we do not have access to and
// make sure that access is denied.
$file_noaccess
=
array_shift
(
$files
);
...
...
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