From 3e2dce53bc82278e9e9f0024df15e389d1189132 Mon Sep 17 00:00:00 2001 From: Shaun Hare Date: Thu, 22 Jun 2017 21:25:18 +0100 Subject: [PATCH] Admin Fixes (#87) * Add CSP middleware (#81) * Hotfix/csp broken admin (#83) * Fix notice on array access * Enable CSP in report-only mode in dashboard * Add comment for CSP override in routing * Admin Fixes (#85) * Add CSP middleware (#81) (#82) * Add CSP middleware (#81) (#84) * Hotfix/csp broken admin (#86) * Fix notice on array access * Enable CSP in report-only mode in dashboard * Add comment for CSP override in routing --- app/routes.php | 5 ++++- app/src/Service/EventsService.php | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/routes.php b/app/routes.php index e099251..ba62d1f 100644 --- a/app/routes.php +++ b/app/routes.php @@ -45,7 +45,10 @@ } return $next($request, $response); -}); +})->add( + // CSP set to report-only mode within the admin area until all issues are resolved + new Pavlakis\Middleware\Csp\CspMiddleware($container->get('csp.config')) +); $app->get('/callback/{callback}', 'PHPMinds\Action\CallbackAction:dispatch') ->setName('callbacks'); diff --git a/app/src/Service/EventsService.php b/app/src/Service/EventsService.php index 02c992c..d814fab 100644 --- a/app/src/Service/EventsService.php +++ b/app/src/Service/EventsService.php @@ -84,7 +84,7 @@ public function getPastEvents() public function getEventById($eventID = null) { $event = $this->meetupService->getEventById($eventID); - $eventInfo = $this->eventManager->getDetailsByMeetupID($event['id']); + $eventInfo = $this->eventManager->getDetailsByMeetupID($event['id'] ?? null); $eventInfo = $eventInfo[0] ?? null; return EventFactory::getMergedFromArrays($event, $eventInfo); @@ -293,7 +293,7 @@ public function createJoindinTalk($userID, $language = 'English - UK') */ public function getEventInfo($meetupID) : array { - return $this->eventManager->getByMeetupID($meetupID)[0] ?: []; + return $this->eventManager->getByMeetupID($meetupID)[0] ?? []; } /**