Commit 898a7b60 authored by pwolanin's avatar pwolanin

SA-CONTRIB-2010-088 follow up fix for nodereference_autocomplete_access() and content_access()

parent d6d7c227
......@@ -2252,7 +2252,10 @@ function content_access($op, $field, $account = NULL, $node = NULL) {
if (is_null($account)) {
$account = $user;
}
// Check for valid field data.
if (!isset($field['field_name'])) {
return FALSE;
}
$access = module_invoke_all('field_access', $op, $field, $account, $node);
foreach ($access as $value) {
if ($value === FALSE) {
......
......@@ -960,7 +960,7 @@ function _nodereference_potential_references_standard($field, $string = '', $mat
* a user has edit but not view access.
*/
function nodereference_autocomplete_access($field_name) {
return user_access('access content') && ($field = content_fields($field_name)) && content_access('view', $field) && content_access('edit', $field);
return user_access('access content') && ($field = content_fields($field_name)) && isset($field['field_name']) && content_access('view', $field) && content_access('edit', $field);
}
/**
......
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