* @return string Formattet HTML.
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
-function prepare_text($text) {
- if (stristr($text, '[nosmile]')) {
- $s = BBCode::convert($text);
- } else {
- $s = Smilies::replace(BBCode::convert($text));
- }
-
+function prepare_text($text)
+{
+ $s = BBCode::convert($text);
return trim($s);
}
$from_name_e = $message['from-name'];
$subject_e = $message['title'];
- $body_e = Smilies::replace(BBCode::convert($message['body']));
+ $body_e = BBCode::convert($message['body']);
$to_name_e = $message['name'];
$contact = Contact::getDetailsByURL($message['from-url']);
// 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);
}