]> git.mxchange.org Git - friendica.git/blobdiff - include/text.php
log the D* publc messages
[friendica.git] / include / text.php
index e3d984a1fe17d3c169a96481f6fbf10f3c77862d..501121c80227418a21f641d363754be8a5112ce4 100644 (file)
@@ -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 '<div class="contact-block-textdiv' . $class . '"><a class="contact-block-link' . $class . $sparkle 
                        . (($click) ? ' fakelink' : '') . '" '
+                       . (($redir) ? ' target="redir" ' : '')
                        . (($url) ? ' href="' . $url . '"' : '') . $click
                        . '" title="' . $contact['name'] . ' [' . $contact['url'] . ']" alt="' . $contact['name'] 
                        . '" >'. $contact['name'] . '</a></div>' . "\r\n";
@@ -593,6 +595,7 @@ function micropro($contact, $redirect = false, $class = '', $textmode = false) {
        else {
                return '<div class="contact-block-div' . $class . '"><a class="contact-block-link' . $class . $sparkle 
                        . (($click) ? ' fakelink' : '') . '" '
+                       . (($redir) ? ' target="redir" ' : '')
                        . (($url) ? ' href="' . $url . '"' : '') . $click . ' ><img class="contact-block-img' . $class . $sparkle . '" src="' 
                        . $contact['micro'] . '" title="' . $contact['name'] . ' [' . $contact['url'] . ']" alt="' . $contact['name'] 
                        . '" /></a></div>' . "\r\n";
@@ -632,7 +635,8 @@ function valid_email($x){
 
 if(! function_exists('linkify')) {
 function linkify($s) {
-       $s = preg_replace("/(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\.\=\_\~\#\'\%\$\!\+]*)/", ' <a href="$1" target="external-link">$1</a>', $s);
+       $s = preg_replace("/(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\'\%\$\!\+]*)/", ' <a href="$1" target="external-link">$1</a>', $s);
+       $s = preg_replace("/\<(.*?)(src|href)=(.*?)\&amp\;(.*?)\>/ism",'<$1$2=$3&$4>',$s);
        return($s);
 }}
 
@@ -653,7 +657,7 @@ if(! function_exists('smilies')) {
 function smilies($s) {
        $a = get_app();
 
-       return str_replace(
+       $s = str_replace(
        array( '&lt;3', '&lt;/3', '&lt;\\3', ':-)', ':)', ';-)', ':-(', ':(', ':-P', ':P', ':-"', ':-x', ':-X', ':-D', '8-|', '8-O', 
                '~friendika', 'Diaspora*' ),
        array(
@@ -677,6 +681,10 @@ function smilies($s) {
                '<a href="http://joindiaspora.com">Diaspora<img src="' . $a->get_baseurl() . '/images/diaspora.png" alt="Diaspora*" /></a>',
 
        ), $s);
+
+       call_hooks('smilie', $s);
+       return $s;
+
 }}