Commit 28725705 authored by Dries's avatar Dries

- Patch #672494 by catch: small performance optimization for field_access().

parent 8f6e5a46
......@@ -704,13 +704,14 @@ function field_has_data($field) {
function field_access($op, $field, $obj_type, $object = NULL, $account = NULL) {
global $user;
if (is_null($account)) {
if (!isset($account)) {
$account = $user;
}
$field_access = module_invoke_all('field_access', $op, $field, $obj_type, $object, $account);
foreach ($field_access as $value) {
if ($value === FALSE) {
foreach (module_implements('field_access') as $module) {
$function = $module . '_field_access';
$access = $function($op, $field, $obj_type, $object, $account);
if ($access === FALSE) {
return FALSE;
}
}
......
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