function messaging_text_check_plain in Messaging 6.4
HTML to text simple filtering.
- Replace some tags with line endings: p, br, hr, li, h1, h2, h3, h4
Strip out all HTML tags and decode entities
Parameters
$text: Text to clean up
$break: Optional character to replace tags for line breaks
$list: Optional item list marker, may be a dash '-' or an asterisk '*'
3 calls to messaging_text_check_plain()
- messaging_check_plain in includes/
text.inc - HTML to text simple filtering.
- Messaging_Method::check_subject in includes/
messaging_method.class.inc - Converts strings to plain utf-8 single line
- messaging_text_filter in includes/
text.inc - Apply filter to message text
1 string reference to 'messaging_text_check_plain'
- _messaging_text_filter_info in includes/
text.inc - Get built in filters info, will be provided on messaging_messaging('filter info')
File
- includes/
text.inc, line 19 - Drupal Messaging Framework - Text filtering functions
Code
function messaging_text_check_plain($text, $break = "\n", $list = '- ') {
// This have to be done before the filtering because tag markers may have been previously parsed with check_plain
$text = str_replace(array(
'<',
'>',
), array(
'<',
'>',
), $text);
// Clean up the HTML and replace some tags with line endings
if (isset($break)) {
$text = _filter_htmlcorrector($text);
$text = str_replace(array(
'</p>',
'<br />',
'<hr />',
'</li>',
'</h1>',
'</h2>',
'</h3>',
'</h4>',
), $break, $text);
if (isset($list)) {
$text = str_replace('<li>', $list, $text);
}
}
// Final text clean up
return messaging_text_clean($text);
}