Ignore (for now), OwnYourSwarm requests with h-adr location value
This commit is contained in:
parent
8ddab8b1de
commit
79d0e78905
1 changed files with 5 additions and 4 deletions
|
@ -142,10 +142,11 @@ class NoteService
|
||||||
*/
|
*/
|
||||||
private function getCheckin(array $request): ?Place
|
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 {
|
try {
|
||||||
$place = resolve(PlaceService::class)->createPlaceFromCheckin(
|
$place = resolve(PlaceService::class)->createPlaceFromCheckin(
|
||||||
array_get($request, 'properties.location.0')
|
$location
|
||||||
);
|
);
|
||||||
} catch (\InvalidArgumentException $e) {
|
} catch (\InvalidArgumentException $e) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -153,12 +154,12 @@ class NoteService
|
||||||
|
|
||||||
return $place;
|
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(
|
return Place::where(
|
||||||
'slug',
|
'slug',
|
||||||
basename(
|
basename(
|
||||||
parse_url(
|
parse_url(
|
||||||
array_get($request, 'properties.location.0'),
|
$location,
|
||||||
PHP_URL_PATH
|
PHP_URL_PATH
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue