X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2FContact.php;h=bb6d8c198178a9002ee0ade07daff13c0ba94d49;hb=71a5de40f105234aa8082844d7839c3e0e49e905;hp=fc9f660f1377e81aba7ae63f274f9dff1a418302;hpb=8f7d191bfca553f9d928666e7ef3b52a26911a8e;p=friendica.git diff --git a/include/Contact.php b/include/Contact.php index fc9f660f13..bb6d8c1981 100644 --- a/include/Contact.php +++ b/include/Contact.php @@ -1,5 +1,8 @@ '0001-01-01') { $bd_timestamp = strtotime($profile["birthday"]); $month = date("m", $bd_timestamp); $day = date("d", $bd_timestamp); @@ -271,7 +256,7 @@ function get_contact_details_by_url($url, $uid = -1, $default = array()) { $profile["bd"] = (++$current_year)."-".$month."-".$day; } } else { - $profile["bd"] = "0000-00-00"; + $profile["bd"] = '0001-01-01'; } } else { $profile = $default; @@ -307,7 +292,7 @@ function get_contact_details_by_url($url, $uid = -1, $default = array()) { $profile["location"] = ""; $profile["about"] = ""; $profile["gender"] = ""; - $profile["birthday"] = "0000-00-00"; + $profile["birthday"] = '0001-01-01'; } $cache[$url][$uid] = $profile; @@ -328,6 +313,10 @@ function get_contact_details_by_url($url, $uid = -1, $default = array()) { function get_contact_details_by_addr($addr, $uid = -1) { static $cache = array(); + if ($addr == '') { + return array(); + } + if ($uid == -1) { $uid = local_user(); } @@ -353,7 +342,6 @@ function get_contact_details_by_addr($addr, $uid = -1) { dbesc($addr)); if (!dbm::is_result($r)) { - require_once('include/Probe.php'); $data = Probe::uri($addr); $profile = get_contact_details_by_url($data['url'], $uid); @@ -534,6 +522,10 @@ function get_contact($url, $uid = 0, $no_update = false) { $data = array(); $contact_id = 0; + if ($url == '') { + return 0; + } + // We first try the nurl (http://server.tld/nick), most common case $contacts = q("SELECT `id`, `avatar-date` FROM `contact` WHERE `nurl` = '%s' @@ -575,7 +567,6 @@ function get_contact($url, $uid = 0, $no_update = false) { return 0; } - require_once('include/Probe.php'); $data = Probe::uri($url); // Last try in gcontact for unsupported networks @@ -692,7 +683,7 @@ function get_contact($url, $uid = 0, $no_update = false) { */ function posts_from_gcontact(App $a, $gcontact_id) { - require_once('include/conversation.php'); + require_once 'include/conversation.php'; // There are no posts with "uid = 0" with connector networks // This speeds up the query a lot @@ -731,7 +722,7 @@ function posts_from_gcontact(App $a, $gcontact_id) { */ function posts_from_contact_url(App $a, $contact_url) { - require_once('include/conversation.php'); + require_once 'include/conversation.php'; // There are no posts with "uid = 0" with connector networks // This speeds up the query a lot @@ -840,4 +831,3 @@ function account_type($contact) { return $account_type; } -?>