summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-06-03 02:38:47 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-06-03 02:38:47 +0000
commit314b9185929822a1cce28b01805eb34f3916f459 (patch)
tree0be53ea48136fad880af2b64034b38de35e116ff
parent34c996e28cea7729ed07d1bec33f51ccca21e607 (diff)
downloadbrdo-314b9185929822a1cce28b01805eb34f3916f459.tar.gz
brdo-314b9185929822a1cce28b01805eb34f3916f459.tar.bz2
#369011 follow-up by yched: Some touch-ups to comments, etc.
-rw-r--r--modules/field/modules/text/text.module10
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/field/modules/text/text.module b/modules/field/modules/text/text.module
index 198b69e7d..7c31d54cb 100644
--- a/modules/field/modules/text/text.module
+++ b/modules/field/modules/text/text.module
@@ -123,13 +123,12 @@ function text_field_load($obj_type, $objects, $field, $instances, &$items) {
foreach ($objects as $id => $object) {
foreach ($items[$id] as $delta => $item) {
- // TODO D7 : this code is really node-related.
if (!empty($instances[$id]['settings']['text_processing'])) {
- $check = is_null($object) || (isset($object->build_mode) && $object->build_mode == NODE_BUILD_PREVIEW);
-
// Only process items with a cacheable format, the rest will be
// handled by text_field_sanitize().
if (filter_format_allowcache($item['format'])) {
+ // TODO D7 : this code is really node-related.
+ $check = is_null($object) || (isset($object->build_mode) && $object->build_mode == NODE_BUILD_PREVIEW);
$text = isset($item['value']) ? check_markup($item['value'], $item['format'], isset($object->language) ? $object->language : $language->language, $check, FALSE) : '';
}
}
@@ -152,10 +151,11 @@ function text_field_sanitize($obj_type, $object, $field, $instance, &$items) {
global $language;
foreach ($items as $delta => $item) {
// Only sanitize items which were not already processed inside
- // text_field_load(), i.e. items with uncacheable text formats.
+ // text_field_load(), i.e. items with uncacheable text formats, or coming
+ // from a form preview.
if (!isset($items[$delta]['safe'])) {
- // TODO D7 : this code is really node-related.
if (!empty($instance['settings']['text_processing'])) {
+ // TODO D7 : this code is really node-related.
$check = is_null($object) || (isset($object->build_mode) && $object->build_mode == NODE_BUILD_PREVIEW);
$text = isset($item['value']) ? check_markup($item['value'], $item['format'], isset($object->language) ? $object->language : $language->language, $check) : '';
}