From 61b727d52e65966f3da499c07e4a80aa13dcb3cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Thu, 29 Nov 2018 10:15:25 +0100 Subject: Allow loading avatars from remote MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/Controller/NavigationController.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/Controller/NavigationController.php') diff --git a/lib/Controller/NavigationController.php b/lib/Controller/NavigationController.php index 0409ef90..3b76ea91 100644 --- a/lib/Controller/NavigationController.php +++ b/lib/Controller/NavigationController.php @@ -45,6 +45,7 @@ use OCA\Social\Service\ActorService; use OCA\Social\Service\ConfigService; use OCA\Social\Service\MiscService; use OCP\AppFramework\Controller; +use OCP\AppFramework\Http\ContentSecurityPolicy; use OCP\AppFramework\Http\DataResponse; use OCP\AppFramework\Http\FileDisplayResponse; use OCP\AppFramework\Http\RedirectResponse; @@ -186,7 +187,11 @@ class NavigationController extends Controller { // neither. } - return new TemplateResponse(Application::APP_NAME, 'main', $data); + $csp = new ContentSecurityPolicy(); + $csp->addAllowedImageDomain('*'); + $response = new TemplateResponse(Application::APP_NAME, 'main', $data); + $response->setContentSecurityPolicy($csp); + return $response; } -- cgit v1.2.3 From 1c5ce8c2696257d5df87525db3decacbb4f48a7e Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Thu, 29 Nov 2018 16:41:12 -0100 Subject: fixing Signed-off-by: Maxence Lange --- lib/Controller/NavigationController.php | 30 ------------------------------ 1 file changed, 30 deletions(-) (limited to 'lib/Controller/NavigationController.php') diff --git a/lib/Controller/NavigationController.php b/lib/Controller/NavigationController.php index 3b76ea91..b14f46bd 100644 --- a/lib/Controller/NavigationController.php +++ b/lib/Controller/NavigationController.php @@ -251,36 +251,6 @@ class NavigationController extends Controller { return $this->navigate(); } - /** - * @NoCSRFRequired - * @PublicPage - * - * @param $username - * - * @return RedirectResponse|PublicTemplateResponse - */ - public function public($username) { - // Redirect to external instances - if (preg_match('/@[\w._-]+@[\w._-]+/', $username) === 1) { - $actor = $this->personService->getFromAccount(substr($username, 1)); - return new RedirectResponse($actor->getUrl()); - } - if (\OC::$server->getUserSession() - ->isLoggedIn()) { - return $this->navigate(); - } - - $data = [ - 'serverData' => [ - 'public' => true, - ] - ]; - $page = new PublicTemplateResponse(Application::APP_NAME, 'main', $data); - $page->setHeaderTitle($this->l10n->t('Social') . ' ' . $username); - - return $page; - } - /** * -- cgit v1.2.3