X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Ftext.php;h=501121c80227418a21f641d363754be8a5112ce4;hb=d7243be2eaab96f56ae639b1afe823a1646811f4;hp=66447069e455ad6c53a9cd90a9514d14bd0361ba;hpb=0d9d576aa642e02eb8673aa20bdf4b6a18ae6bc3;p=friendica.git diff --git a/include/text.php b/include/text.php index 66447069e4..501121c802 100644 --- a/include/text.php +++ b/include/text.php @@ -482,13 +482,12 @@ function get_tags($s) { // we might be inside a bbcode color tag - leave it alone continue; } + if(substr($mtch,-1,1) === '.') + $mtch = substr($mtch,0,-1); // ignore strictly numeric tags like #1 if((strpos($mtch,'#') === 0) && ctype_digit(substr($mtch,1))) continue; - if(substr($mtch,-1,1) === '.') - $ret[] = substr($mtch,0,-1); - else - $ret[] = $mtch; + $ret[] = $mtch; } } return $ret; @@ -571,11 +570,13 @@ function micropro($contact, $redirect = false, $class = '', $textmode = false) { $url = $contact['url']; $sparkle = ''; + $redir = false; if($redirect) { $a = get_app(); $redirect_url = $a->get_baseurl() . '/redir/' . $contact['id']; if(local_user() && ($contact['uid'] == local_user()) && ($contact['network'] === 'dfrn')) { + $redir = true; $url = $redirect_url; $sparkle = ' sparkle'; } @@ -586,6 +587,7 @@ function micropro($contact, $redirect = false, $class = '', $textmode = false) { if($textmode) { return '
'. $contact['name'] . '
' . "\r\n"; @@ -593,6 +595,7 @@ function micropro($contact, $redirect = false, $class = '', $textmode = false) { else { return '
' . $contact['name'] 
 			. '
' . "\r\n"; @@ -602,12 +605,14 @@ function micropro($contact, $redirect = false, $class = '', $textmode = false) { if(! function_exists('search')) { -function search($s,$id='search-box',$url='/search') { +function search($s,$id='search-box',$url='/search',$save = false) { $a = get_app(); $o = '
'; $o .= '
'; $o .= ''; $o .= ''; + if($save) + $o .= ''; $o .= '
'; return $o; }} @@ -630,7 +635,8 @@ function valid_email($x){ if(! function_exists('linkify')) { function linkify($s) { - $s = preg_replace("/(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\.\=\_\~\#\'\%\$\!\+]*)/", ' $1', $s); + $s = preg_replace("/(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\'\%\$\!\+]*)/", ' $1', $s); + $s = preg_replace("/\<(.*?)(src|href)=(.*?)\&\;(.*?)\>/ism",'<$1$2=$3&$4>',$s); return($s); }} @@ -651,7 +657,7 @@ if(! function_exists('smilies')) { function smilies($s) { $a = get_app(); - return str_replace( + $s = str_replace( array( '<3', '</3', '<\\3', ':-)', ':)', ';-)', ':-(', ':(', ':-P', ':P', ':-"', ':-x', ':-X', ':-D', '8-|', '8-O', '~friendika', 'Diaspora*' ), array( @@ -675,6 +681,10 @@ function smilies($s) { 'DiasporaDiaspora*', ), $s); + + call_hooks('smilie', $s); + return $s; + }}