From 79d0e789058302e7da915386208a7fdfcdec14bb Mon Sep 17 00:00:00 2001 From: Jonny Barnes Date: Sat, 17 Feb 2018 21:50:46 +0000 Subject: [PATCH] Ignore (for now), OwnYourSwarm requests with h-adr location value --- app/Services/NoteService.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/Services/NoteService.php b/app/Services/NoteService.php index b29f5d3c..eb3e25a0 100644 --- a/app/Services/NoteService.php +++ b/app/Services/NoteService.php @@ -142,10 +142,11 @@ class NoteService */ private function getCheckin(array $request): ?Place { - if (array_get($request, 'properties.location.0.type.0') === 'h-card') { + $location = array_get($request, 'properties.location.0'); + if (array_get($location, 'type.0') === 'h-card') { try { $place = resolve(PlaceService::class)->createPlaceFromCheckin( - array_get($request, 'properties.location.0') + $location ); } catch (\InvalidArgumentException $e) { return null; @@ -153,12 +154,12 @@ class NoteService return $place; } - if (starts_with(array_get($request, 'properties.location.0'), config('app.url'))) { + if (is_string($location) && starts_with($location, config('app.url'))) { return Place::where( 'slug', basename( parse_url( - array_get($request, 'properties.location.0'), + $location, PHP_URL_PATH ) )