X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FProtocol%2FDFRN.php;h=2abdfe14869fc128a0911ecb8234f963b4f81ba4;hb=bcc8ed378c1920bc66d0f301f1060e7ebf894999;hp=12c93ea2fb4bd2803be61796ec302e34ffee678a;hpb=b5a9a1f1d312b50631c2f8b35807f74116d912a8;p=friendica.git diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php index 12c93ea2fb..2abdfe1486 100644 --- a/src/Protocol/DFRN.php +++ b/src/Protocol/DFRN.php @@ -29,6 +29,7 @@ use Friendica\Model\Mail; use Friendica\Model\PermissionSet; use Friendica\Model\Profile; use Friendica\Model\User; +use Friendica\Network\Probe; use Friendica\Object\Image; use Friendica\Util\BaseURL; use Friendica\Util\Crypto; @@ -3041,4 +3042,19 @@ class DFRN return (strcmp($existing_edited, $update_edited) < 0); } + + /** + * Checks if the given contact url does support DFRN + * + * @param string $url profile url + * @param boolean $update Update the profile + * @return boolean + * @throws \Friendica\Network\HTTPException\InternalServerErrorException + * @throws \ImagickException + */ + public static function isSupportedByContactUrl($url, $update = false) + { + $probe = Probe::uri($url, Protocol::DFRN, 0, !$update); + return $probe['network'] == Protocol::DFRN; + } }