Improved default value handling

This commit is contained in:
Michael Vogel 2016-06-19 01:22:32 +02:00
parent e512a83ecc
commit c3ed6f7d01

View file

@ -255,11 +255,20 @@ function get_contact_details_by_url($url, $uid = -1, $default = array()) {
$profile["bd"] = (++$current_year)."-".$month."-".$day; $profile["bd"] = (++$current_year)."-".$month."-".$day;
} else } else
$profile["bd"] = "0000-00-00"; $profile["bd"] = "0000-00-00";
} else { } else
$profile = $default; $profile = $default;
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"])) if (!isset($profile["thumb"]) AND isset($profile["photo"]))
$profile["thumb"] = $profile["photo"]; $profile["thumb"] = $profile["photo"];
}
if ((($profile["addr"] == "") OR ($profile["name"] == "")) AND ($profile["gid"] != 0) AND if ((($profile["addr"] == "") OR ($profile["name"] == "")) AND ($profile["gid"] != 0) AND
in_array($profile["network"], array(NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS))) in_array($profile["network"], array(NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS)))