]> git.mxchange.org Git - friendica.git/commitdiff
Improved default value handling
authorMichael Vogel <icarus@dabo.de>
Sat, 18 Jun 2016 23:22:32 +0000 (01:22 +0200)
committerMichael Vogel <icarus@dabo.de>
Sat, 18 Jun 2016 23:22:32 +0000 (01:22 +0200)
include/Contact.php

index 896edaac7dd1eb2e601abe17172dd00137e47f7d..3ee491e50538cd26d2347f294a223c9272399bf9 100644 (file)
@@ -255,11 +255,20 @@ function get_contact_details_by_url($url, $uid = -1, $default = array()) {
                                $profile["bd"] = (++$current_year)."-".$month."-".$day;
                } else
                        $profile["bd"] = "0000-00-00";
-       } else {
+       } else
                $profile = $default;
-               if (!isset($profile["thumb"]) AND isset($profile["photo"]))
-                       $profile["thumb"] = $profile["photo"];
-       }
+
+       if (($profile["photo"] == "") AND isset($default["photo"]))
+               $profile["photo"] = $default["photo"];
+
+       if (($profile["name"] == "") AND isset($default["name"]))
+               $profile["name"] = $default["name"];
+
+       if (($profile["network"] == "") AND isset($default["network"]))
+               $profile["network"] = $default["network"];
+
+       if (!isset($profile["thumb"]) AND isset($profile["photo"]))
+               $profile["thumb"] = $profile["photo"];
 
        if ((($profile["addr"] == "") OR ($profile["name"] == "")) AND ($profile["gid"] != 0) AND
                in_array($profile["network"], array(NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS)))