Commit 7504db84 authored by quicksketch's avatar quicksketch

#516104 by nonzero: Slightly shorter IF statement for file download access check.

parent 654c8f9a
......@@ -180,8 +180,7 @@ function filefield_file_download($file) {
if (isset($nodes[$content['nid']])) {
continue; // Don't check the same node twice.
}
$node = node_load($content['nid']);
if ($denied == FALSE && node_access('view', $node) == FALSE) {
if ($denied == FALSE && ($node = node_load($content['nid'])) && node_access('view', $node) == FALSE) {
// You don't have permission to view the node this file is attached to.
$denied = TRUE;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment