]> git.mxchange.org Git - friendica.git/blobdiff - include/bbcode.php
menu entry for "Delegations" moved to the settings.
[friendica.git] / include / bbcode.php
index 342cd7be5f208d60997e8599c7a4c208b15a8b7d..d1cb1a9110d3484a48f75e4dc66dd9e5ff379d89 100644 (file)
@@ -55,8 +55,8 @@ function bb_cleanup_share($shared) {
         if (strpos($shared[1],$title) !== false)
                 $title = "";
 
-        if (strpos($shared[1],$link) !== false)
-                $link = "";
+//        if (strpos($shared[1],$link) !== false)
+//                $link = "";
 
         $text = trim($shared[1]);
 
@@ -520,7 +520,8 @@ function bb_ShareAttributesSimple2($match) {
 
        $userid = GetProfileUsername($profile,$author);
 
-        $text = "<br />".html_entity_decode("&#x2672; ", ENT_QUOTES, 'UTF-8').' <a href="'.$profile.'">'.$userid."</a>: <br />".$match[2];
+        //$text = "<br />".html_entity_decode("&#x2672; ", ENT_QUOTES, 'UTF-8').' <a href="'.$profile.'">'.$userid."</a>: <br />".$match[2];
+        $text = "<br />".html_entity_decode("&#x2672; ", ENT_QUOTES, 'UTF-8').' '.$userid.": <br />".$match[2];
 
         return($text);
 }
@@ -554,10 +555,13 @@ function GetProfileUsername($profile, $username) {
                }
        }
 
-       // To-Do: Better check for pumpio
-       $pumpio = preg_replace("=https?://([^/]*).*/(\w*)=ism", "$2@$1", $profile);
-       if ($pumpio != $profile)
-               return($username." (".$pumpio.")");
+       // pumpio (http://host.name/user)
+       $rest = preg_replace("=https?://([\.\w]+)/([\.\w]+)(.*)=ism", "$3", $profile);
+       if ($rest == "") {
+               $pumpio = preg_replace("=https?://([\.\w]+)/([\.\w]+)(.*)=ism", "*$2@$1*", $profile);
+               if ($pumpio != $profile)
+                       return($username." (".$pumpio.")");
+       }
 
        return($username);
 }