*/
public static function toPlaintext($text, $keep_urls = true)
{
- $naked_text = preg_replace('/\[(.+?)\]\s*/','', $text);
+ $naked_text = preg_replace('/\[.+?\]/','', $text);
if (!$keep_urls) {
$naked_text = preg_replace('#https?\://[^\s<]+[^\s\.\)]#i', '', $naked_text);
}
// This is actually executed in Item::prepareBody()
+ $nosmile = strpos($text, '[nosmile]') !== false;
$text = str_replace('[nosmile]', '', $text);
// Check for font change text
}
// Replace non graphical smilies for external posts
- if ($simple_html) {
+ if (!$nosmile && !$for_plaintext) {
$text = Smilies::replace($text);
}