diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-01-02 18:50:51 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-01-02 18:50:51 +0000 |
commit | 28725705814a5ac25dbcc1665503325b44352f7d (patch) | |
tree | 69caa9aafe4e5e4c885b1da70febe6ffa3980489 /modules | |
parent | 8f6e5a46790fad34271aa8baeca4750af4022160 (diff) | |
download | brdo-28725705814a5ac25dbcc1665503325b44352f7d.tar.gz brdo-28725705814a5ac25dbcc1665503325b44352f7d.tar.bz2 |
- Patch #672494 by catch: small performance optimization for field_access().
Diffstat (limited to 'modules')
-rw-r--r-- | modules/field/field.module | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/modules/field/field.module b/modules/field/field.module index 62dbc68e7..070b4e521 100644 --- a/modules/field/field.module +++ b/modules/field/field.module @@ -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; } } |