Merge pull request #319 from nextcloud/backport/313/master

[master] check address of the account
pull/321/head
Maxence Lange 2019-01-09 14:44:37 -01:00 zatwierdzone przez GitHub
commit 0faf332b05
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 9 dodań i 2 usunięć

Wyświetl plik

@ -97,4 +97,4 @@ matrix:
- TESTS: vue-build
branches: [ master, stable* ]
branches: [ master, stable*, alpha1 ]

Wyświetl plik

@ -31,6 +31,7 @@ namespace OCA\Social;
use Exception;
use OCA\Social\Service\CacheActorService;
use OCA\Social\Service\ConfigService;
require_once(__DIR__ . '/../appinfo/autoload.php');
@ -51,10 +52,16 @@ if ($type !== 'acct') {
}
$username = substr($account, 0, strrpos($account, '@'));
list($username, $instance) = explode('@', $account);
try {
$cacheActorService = \OC::$server->query(CacheActorService::class);
$configService = \OC::$server->query(ConfigService::class);
if ($configService->getCloudAddress(true) !== $instance) {
throw new Exception();
}
$cacheActorService->getFromLocalAccount($username);
} catch (Exception $e) {
http_response_code(404);