kopia lustrzana https://github.com/nextcloud/social
checking if the account is a valid mail address
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>pull/226/head
rodzic
b7e3a6dc2b
commit
35be62836f
|
@ -92,14 +92,15 @@ class CurlService {
|
|||
public function retrieveAccount(string $account): Person {
|
||||
$account = $this->withoutBeginAt($account);
|
||||
|
||||
if (strstr(substr($account, 0, -3), '@') === false) {
|
||||
// we consider an account is like an email
|
||||
if (!filter_var($account, FILTER_VALIDATE_EMAIL)) {
|
||||
throw new InvalidResourceException();
|
||||
}
|
||||
list($username, $host) = explode('@', $account);
|
||||
|
||||
// if ($username === null || $host === null) {
|
||||
// throw new InvalidResourceException();
|
||||
// }
|
||||
list($username, $host) = explode('@', $account);
|
||||
if ($username === null || $host === null) {
|
||||
throw new InvalidResourceException();
|
||||
}
|
||||
|
||||
$request = new Request('/.well-known/webfinger');
|
||||
$request->addData('resource', 'acct:' . $account);
|
||||
|
|
Ładowanie…
Reference in New Issue