From b935a2b6d95dbdfcaa30e18dde9151b65bc65550 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 19 Dec 2017 11:54:02 +0000 Subject: [PATCH] Woraround for bad mastodon links --- src/Protocol/PortableContact.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/Protocol/PortableContact.php b/src/Protocol/PortableContact.php index e5573d1cee..b395337673 100644 --- a/src/Protocol/PortableContact.php +++ b/src/Protocol/PortableContact.php @@ -860,6 +860,13 @@ class PortableContact $orig_last_failure = $last_failure; $orig_last_contact = $last_contact; + // Mastodon uses the "@" for user profiles. + // But this can be misunderstood. + if (parse_url($server_url, PHP_URL_USER) != '') { + dba::update('gserver', array('last_failure' => datetime_convert()), array('nurl' => normalise_link($server_url))); + return false; + } + // Check if the page is accessible via SSL. $orig_server_url = $server_url; $server_url = str_replace("http://", "https://", $server_url); @@ -914,11 +921,6 @@ class PortableContact if (!$failure) { // This will be too low, but better than no value at all. $registered_users = dba::count('gcontact', ['server_url' => normalise_link($server_url)]); - - // Every server has got an admin account at least - if ($registered_users == 0) { - $registered_users = 1; - } } // Look for poco @@ -1213,6 +1215,11 @@ class PortableContact } } + // Every server has got at least an admin account + if (!$failure && ($registered_users == 0)) { + $registered_users = 1; + } + if ($possible_failure && !$failure) { $failure = true; } -- 2.39.5