What are the differences between ['value']
and ['safe_value']
?
3 Answers
It is a value, passed through the function _text_sanitize()
. You can read more in the official docs.
If you are using 'safe_value'
, you may be also interested in this article: Rendering Drupal 7 fields (the right way).
The main difference it that the safe_value is passed through the function _text_sanitize().
-
3
-
1Depending on the type of value you want in
safe_value
, you can forego the use of_text_sanitize()
and usecheck_plain($text)
for plain text orcheck_markup($text, $format)
for HTML Commented Nov 20, 2014 at 12:21
For Readers benefit, DO NOT use safe_value data when making SQL statements. In other words, strings containing ampersand ( & ) will become ( &
) fail to get the expected results.