]> git.mxchange.org Git - friendica.git/commitdiff
When a user isn't logged in, then the item link got to an invalid address.
authorMichael Vogel <icarus@dabo.de>
Thu, 20 Mar 2014 17:46:35 +0000 (18:46 +0100)
committerMichael Vogel <icarus@dabo.de>
Thu, 20 Mar 2014 17:46:35 +0000 (18:46 +0100)
include/text.php

index e82383cddf20ae21ec1d081910a028d1f2489ddd..71f75bf31345c94097f1c2490753e4e0d8a62224 100644 (file)
@@ -1609,16 +1609,27 @@ if(! function_exists('get_plink')) {
  */
 function get_plink($item) {
        $a = get_app();
-       $ret = array(
-                       'href' => $a->get_baseurl()."/display/".$a->user['nickname']."/".$item['id'],
-                       'title' => t('link to source'),
-               );
 
-       $ret["orig"] = $ret["href"];
+       if ($a->user['nickname'] != "") {
+               $ret = array(
+                               'href' => $a->get_baseurl()."/display/".$a->user['nickname']."/".$item['id'],
+                               'title' => t('link to source'),
+                       );
+               $ret["orig"] = $ret["href"];
+
+               if (x($item,'plink'))
+                       $ret["href"] = $item['plink'];
+
+       } elseif (x($item,'plink') && ($item['private'] != 1))
+               $ret = array(
+                               'href' => $item['plink'],
+                               'orig' => $item['plink'],
+                               'title' => t('link to source'),
+                       );
+       else
+               $ret = array();
 
        //if (x($item,'plink') && ($item['private'] != 1))
-       if (x($item,'plink'))
-               $ret["href"] = $item['plink'];
 
        return($ret);
 }}