]> git.mxchange.org Git - friendica.git/commitdiff
Bugfixes: 1. When posting shared feeds to Diaspora, the link vanished/2. The profile...
authorMichael Vogel <icarus@dabo.de>
Tue, 22 Apr 2014 22:34:34 +0000 (00:34 +0200)
committerMichael Vogel <icarus@dabo.de>
Tue, 22 Apr 2014 22:34:34 +0000 (00:34 +0200)
include/bbcode.php

index 308cbf1be18925ca9b51873a7dfd915a89d9a709..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]);
 
@@ -555,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);
 }