Replace "Probe::uri" with "Contact::getByURL"
This commit is contained in:
@@ -22,8 +22,8 @@
|
||||
namespace Friendica\Module;
|
||||
|
||||
use Friendica\BaseModule;
|
||||
use Friendica\Network\Probe;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Model\Contact;
|
||||
|
||||
/**
|
||||
* Redirects to another URL based on the parameter 'addr'
|
||||
@@ -35,9 +35,9 @@ class Acctlink extends BaseModule
|
||||
$addr = trim($_GET['addr'] ?? '');
|
||||
|
||||
if ($addr) {
|
||||
$url = Probe::uri($addr)['url'] ?? '';
|
||||
$url = Contact::getByURL($addr)['url'] ?? '';
|
||||
if ($url) {
|
||||
System::externalRedirect($url);
|
||||
System::externalRedirect($url['url']);
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ use Friendica\Core\Protocol;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\Core\Search;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Model\Contact;
|
||||
use Friendica\Model\Profile;
|
||||
use Friendica\Network\Probe;
|
||||
|
||||
@@ -61,8 +62,8 @@ class RemoteFollow extends BaseModule
|
||||
}
|
||||
|
||||
// Detect the network, make sure the provided URL is valid
|
||||
$data = Probe::uri($url);
|
||||
if ($data['network'] == Protocol::PHANTOM) {
|
||||
$data = Contact::getByURL($url);
|
||||
if (!$data) {
|
||||
notice(DI::l10n()->t("The provided profile link doesn't seem to be valid"));
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user