X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FContact.php;h=cf90406e24a029d5afbc2cd83eceebfce9d95922;hb=3cd654e76f32dbcf505aef6a60a3e42d318f8b61;hp=8937f198c772256fe2599b48e4c6e3b3f31f2b7f;hpb=3d839bb176c44a9733a14a4d65ae4323aa3a1cb0;p=friendica.git diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 8937f198c7..cf90406e24 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -35,12 +35,6 @@ class Contact extends BaseObject * @deprecated since version 2019.03 * @see User::PAGE_FLAGS_NORMAL */ - const PAGE_NORMAL = 0; - const PAGE_SOAPBOX = 1; - const PAGE_COMMUNITY = 2; - const PAGE_FREELOVE = 3; - const PAGE_BLOG = 4; - const PAGE_PRVGROUP = 5; const PAGE_NORMAL = User::PAGE_FLAGS_NORMAL; /** * @deprecated since version 2019.03 @@ -72,7 +66,7 @@ class Contact extends BaseObject */ /** - * @name account types + * Account types * * TYPE_UNKNOWN - the account has been imported from gcontact where this is the default type value * @@ -668,7 +662,7 @@ class Contact extends BaseObject { if (!isset($contact['url']) && !empty($contact['id'])) { $fields = ['id', 'url', 'archive', 'self', 'term-date']; - $contact = DBA::selectFirst('contact', [], ['id' => $contact['id']]); + $contact = DBA::selectFirst('contact', $fields, ['id' => $contact['id']]); if (!DBA::isResult($contact)) { return; } @@ -731,7 +725,7 @@ class Contact extends BaseObject if (!isset($contact['url']) && !empty($contact['id'])) { $fields = ['id', 'url', 'batch']; - $contact = DBA::selectFirst('contact', [], ['id' => $contact['id']]); + $contact = DBA::selectFirst('contact', $fields, ['id' => $contact['id']]); if (!DBA::isResult($contact)) { return; } @@ -1205,9 +1199,10 @@ class Contact extends BaseObject $contact = DBA::selectFirst('contact', $fields, ['addr' => $url]); } + // The link could be provided as http although we stored it as https + $ssl_url = str_replace('http://', 'https://', $url); + if (!DBA::isResult($contact)) { - // The link could be provided as http although we stored it as https - $ssl_url = str_replace('http://', 'https://', $url); $condition = ['alias' => [$url, Strings::normaliseLink($url), $ssl_url]]; $contact = DBA::selectFirst('contact', $fields, $condition); } @@ -1426,7 +1421,7 @@ class Contact extends BaseObject { $a = self::getApp(); - $cid = Self::getIdForURL($contact_url); + $cid = self::getIdForURL($contact_url); $contact = DBA::selectFirst('contact', ['contact-type', 'network'], ['id' => $cid]); if (!DBA::isResult($contact)) { @@ -1758,7 +1753,7 @@ class Contact extends BaseObject } } elseif (Config::get('system', 'dfrn_only') && ($ret['network'] != Protocol::DFRN)) { $result['message'] = L10n::t('This site is not configured to allow communications with other networks.') . EOL; - $result['message'] != L10n::t('No compatible communication protocols or feeds were discovered.') . EOL; + $result['message'] .= L10n::t('No compatible communication protocols or feeds were discovered.') . EOL; return $result; }