function messaging_check_plain in Messaging 6.3
Same name and namespace in other branches
- 5 messaging.module \messaging_check_plain()
- 6.4 includes/text.inc \messaging_check_plain()
- 6 messaging.module \messaging_check_plain()
- 6.2 messaging.module \messaging_check_plain()
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
3 calls to messaging_check_plain()
- messaging_check_subject in ./
messaging.module - Converts strings to plain utf-8 single line
- messaging_filter in ./
messaging.module - Implementation of hook_filter(). Contains a basic set of essential filters.
- Messaging_Send_Method::check_subject in classes/
messaging_method.class.inc - Converts strings to plain utf-8 single line
File
- ./
messaging.module, line 562
Code
function messaging_check_plain($text, $break = NULL) {
// 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);
}
// Final text clean up
return messaging_text_clean($text);
}