Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
314b9185
Commit
314b9185
authored
Jun 03, 2009
by
webchick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#369011
follow-up by yched: Some touch-ups to comments, etc.
parent
34c996e2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
modules/field/modules/text/text.module
modules/field/modules/text/text.module
+5
-5
No files found.
modules/field/modules/text/text.module
View file @
314b9185
...
...
@@ -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
)
:
''
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment