Commit 314b9185 authored by webchick's avatar webchick

#369011 follow-up by yched: Some touch-ups to comments, etc.

parent 34c996e2
......@@ -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) : '';
}
......
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