X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Ftext.php;h=4726872ec299f4656770d8be29df5dac883093a2;hb=573670fa0c8a3d8f111430985d263499b79a6ac0;hp=701c1e41b6352c887df78f499c98c44018742b2b;hpb=a7559fb045150dcb953d5329586c245f43a34c5c;p=friendica.git
diff --git a/include/text.php b/include/text.php
index 701c1e41b6..4726872ec2 100644
--- a/include/text.php
+++ b/include/text.php
@@ -195,6 +195,9 @@ function unxmlify($s) {
if(! function_exists('hex2bin')) {
function hex2bin($s) {
+ if(! (is_string($s) && strlen($s)))
+ return '';
+
if(! ctype_xdigit($s)) {
logger('hex2bin: illegal input: ' . print_r(debug_backtrace(), true));
return($s);
@@ -478,7 +481,7 @@ function get_tags($s) {
// Otherwise pull out single word tags. These can be @nickname, @first_last
// and #hash tags.
- if(preg_match_all('/([@#][^ \x0D\x0A,:?]+)([ \x0D\x0A,:?]|$)/',$s,$match)) {
+ if(preg_match_all('/([@#][^ \x0D\x0A,;:?]+)([ \x0D\x0A,;:?]|$)/',$s,$match)) {
foreach($match[1] as $mtch) {
if(strstr($mtch,"]")) {
// we might be inside a bbcode color tag - leave it alone
@@ -669,7 +672,7 @@ function smilies($s) {
$s = str_replace(
array( '<3', '</3', '<\\3', ':-)', ':)', ';-)', ':-(', ':(', ':-P', ':P', ':-"', ':-x', ':-X', ':-D', '8-|', '8-O',
- '~friendika', 'Diaspora*' ),
+ '~friendika', '~friendica', 'Diaspora*' ),
array(
'',
'
',
@@ -688,7 +691,8 @@ function smilies($s) {
'
',
'
',
'~friendika
',
- 'Diaspora
',
+ '~friendica
',
+ 'Diaspora
',
), $s);
@@ -748,7 +752,9 @@ function prepare_body($item,$attach = false) {
$s = prepare_text($item['body']);
- call_hooks('prepare_body', $s);
+ $prep_arr = array('item' => $item, 'html' => $s);
+ call_hooks('prepare_body', $prep_arr);
+ $s = $prep_arr['html'];
if(! $attach)
return $s;
@@ -781,8 +787,19 @@ function prepare_body($item,$attach = false) {
}
$s .= '