1
0
Fork 0

Merge pull request #7000 from MrPetovan/task/6999-no-probe-magic-link

Remove probing in magic link construction
This commit is contained in:
Philipp 2019-05-03 08:43:26 +02:00 committed by GitHub
commit c9cce8492e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1163,7 +1163,7 @@ class Contact extends BaseObject
* *
* @return array Contact array in the "probe" structure * @return array Contact array in the "probe" structure
*/ */
private static function getProbeDataFromDatabase($url, $cid) private static function getProbeDataFromDatabase($url, $cid = null)
{ {
// The link could be provided as http although we stored it as https // The link could be provided as http although we stored it as https
$ssl_url = str_replace('http://', 'https://', $url); $ssl_url = str_replace('http://', 'https://', $url);
@ -2285,12 +2285,12 @@ class Contact extends BaseObject
return $url ?: $contact_url; // Equivalent to: ($url != '') ? $url : $contact_url; return $url ?: $contact_url; // Equivalent to: ($url != '') ? $url : $contact_url;
} }
$cid = self::getIdForURL($contact_url, 0, true); $data = self::getProbeDataFromDatabase($contact_url);
if (empty($cid)) { if (empty($data)) {
return $url ?: $contact_url; // Equivalent to: ($url != '') ? $url : $contact_url; return $url ?: $contact_url; // Equivalent to: ($url != '') ? $url : $contact_url;
} }
return self::magicLinkbyId($cid, $url); return self::magicLinkByContact($data, $contact_url);
} }
/** /**