From 7fccfc23257b6103e999ec90a8120b8f5cc69521 Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Thu, 11 Jul 2019 18:26:34 -0100 Subject: fixing some conversion Signed-off-by: Maxence Lange --- lib/Controller/LocalController.php | 4 +++- lib/Controller/NavigationController.php | 6 ++++++ lib/Service/ConfigService.php | 6 +++++- lib/Service/CurlService.php | 2 +- 4 files changed, 15 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/Controller/LocalController.php b/lib/Controller/LocalController.php index 8ba30850..0d2a8ca9 100644 --- a/lib/Controller/LocalController.php +++ b/lib/Controller/LocalController.php @@ -804,7 +804,9 @@ class LocalController extends Controller { $this->cacheActorService->setViewer($this->viewer); } catch (Exception $e) { if ($exception) { - throw new AccountDoesNotExistException(); + throw new AccountDoesNotExistException( + 'unable to initViewer - ' . get_class($e) . ' - ' . $e->getMessage() + ); } } } diff --git a/lib/Controller/NavigationController.php b/lib/Controller/NavigationController.php index 1bb8a941..c4438e5a 100644 --- a/lib/Controller/NavigationController.php +++ b/lib/Controller/NavigationController.php @@ -165,6 +165,12 @@ class NavigationController extends Controller { } } + try { + $this->configService->getSocialUrl(); + } catch (SocialAppConfigException $e) { + $this->configService->setSocialUrl(''); + } + if ($data['serverData']['isAdmin']) { $checks = $this->checkService->checkDefault(); $data['serverData']['checks'] = $checks; diff --git a/lib/Service/ConfigService.php b/lib/Service/ConfigService.php index 206315b4..84458d15 100644 --- a/lib/Service/ConfigService.php +++ b/lib/Service/ConfigService.php @@ -367,10 +367,14 @@ class ConfigService { /** * @param string $url + * + * @throws SocialAppConfigException */ public function setSocialUrl(string $url = '') { if ($url === '') { - $url = $this->urlGenerator->linkToRoute('social.Navigation.navigate'); + $url = $this->getCloudUrl() . $this->urlGenerator->linkToRoute( + 'social.Navigation.navigate' + ); } $this->setAppValue(self::SOCIAL_URL, $url); diff --git a/lib/Service/CurlService.php b/lib/Service/CurlService.php index 7baf5aa8..90017e2c 100644 --- a/lib/Service/CurlService.php +++ b/lib/Service/CurlService.php @@ -337,7 +337,7 @@ class CurlService { $request = new Request($path, Request::TYPE_POST); $request->setAddress($this->configService->getCloudHost()); - $request->setProtocol($this->get('scheme', parse_url($address, PHP_URL_SCHEME), 'https')); + $request->setProtocol(parse_url($address, PHP_URL_SCHEME)); try { $this->request($request); -- cgit v1.2.3