Improved url detection
This commit is contained in:
parent
70d0f087b7
commit
db12814f3b
|
@ -28,6 +28,7 @@ use Friendica\DI;
|
|||
use Friendica\Model\Contact;
|
||||
use Friendica\Module\BaseApi;
|
||||
use Friendica\Object\Search\ContactResult;
|
||||
use Friendica\Util\Network;
|
||||
|
||||
/**
|
||||
* @see https://docs.joinmastodon.org/methods/accounts/
|
||||
|
@ -52,7 +53,7 @@ class Search extends BaseApi
|
|||
$accounts = [];
|
||||
|
||||
if ($request['resolve']) {
|
||||
if ((strrpos($request['q'], '@') > 0)) {
|
||||
if ((strrpos($request['q'], '@') > 0) || Network::isValidHttpUrl($request['q'])) {
|
||||
$results = CoreSearch::getContactsFromProbe($request['q']);
|
||||
}
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@ use Friendica\Model\Post;
|
|||
use Friendica\Model\Tag;
|
||||
use Friendica\Module\BaseApi;
|
||||
use Friendica\Object\Search\ContactResult;
|
||||
use Friendica\Util\Network;
|
||||
|
||||
/**
|
||||
* @see https://docs.joinmastodon.org/methods/search/
|
||||
|
@ -84,7 +85,7 @@ class Search extends BaseApi
|
|||
$accounts = [];
|
||||
|
||||
if ($resolve) {
|
||||
if ((strrpos($q, '@') > 0)) {
|
||||
if ((strrpos($q, '@') > 0) || Network::isValidHttpUrl($q)) {
|
||||
$results = CoreSearch::getContactsFromProbe($q);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user