Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function parse_message($text)
- {
- global $pun_config, $lang_common, $pun_user;
- $text = pun_htmlspecialchars($text);
- if ($pun_config['o_censoring'] == '1')
- $text = censor_words($text);
- // Convert applicable characters to HTML entities
- // If the message contains a code tag we have to split it up (text within [code][/code] shouldn't be touched)
- if (strpos($text, '[code]') !== false && strpos($text, '[/code]') !== false)
- list($inside, $text) = extract_blocks($text, '[code]', '[/code]');
- // Deal with newlines, tabs and multiple spaces
- $pattern = array("\n", "\t", ' ', ' ');
- $replace = array('<br />', '    ', '  ', '  ');
- $text = str_replace($pattern, $replace, $text);
- $text = preg_replace( "#\[img\](.+?)\[/img\]#ie" , "\\regex_check_image('\\1')" , $text );
- //end Dirties
- return clean_paragraphs($text);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement