summaryrefslogtreecommitdiff
path: root/modules/file/file.module
diff options
context:
space:
mode:
authorDavid Rothstein <drothstein@gmail.com>2016-02-24 14:25:49 -0500
committerDavid Rothstein <drothstein@gmail.com>2016-02-24 14:25:49 -0500
commitb8d9c44f83eca57039f648a0edb0f369f8d3e6b4 (patch)
tree2b97fdea5a364b7abc6728fb364244c0a52cbc73 /modules/file/file.module
parent2f54b101bf722849e456d859876b27b90ad7e479 (diff)
downloadbrdo-b8d9c44f83eca57039f648a0edb0f369f8d3e6b4.tar.gz
brdo-b8d9c44f83eca57039f648a0edb0f369f8d3e6b4.tar.bz2
Revert "Drupal 7.43"
This reverts commit 2f54b101bf722849e456d859876b27b90ad7e479.
Diffstat (limited to 'modules/file/file.module')
-rw-r--r--modules/file/file.module15
1 files changed, 5 insertions, 10 deletions
diff --git a/modules/file/file.module b/modules/file/file.module
index 9e091af03..fbf8b81ec 100644
--- a/modules/file/file.module
+++ b/modules/file/file.module
@@ -529,18 +529,13 @@ function file_managed_file_value(&$element, $input = FALSE, $form_state = NULL)
// publicly accessible, with no download restrictions; for security
// reasons all other schemes must go through the file_download_access()
// check.
- if (!in_array(file_uri_scheme($file->uri), variable_get('file_public_schema', array('public'))) && !file_download_access($file->uri)) {
- $force_default = TRUE;
- }
- // Temporary files that belong to other users should never be allowed.
- // Since file ownership can't be determined for anonymous users, they
- // are not allowed to reuse temporary files at all.
- elseif ($file->status != FILE_STATUS_PERMANENT && (!$GLOBALS['user']->uid || $file->uid != $GLOBALS['user']->uid)) {
- $force_default = TRUE;
+ if (in_array(file_uri_scheme($file->uri), variable_get('file_public_schema', array('public'))) || file_download_access($file->uri)) {
+ $fid = $file->fid;
}
- // If all checks pass, allow the file to be changed.
+ // If the current user doesn't have access, don't let the file be
+ // changed.
else {
- $fid = $file->fid;
+ $force_default = TRUE;
}
}
}