diff --git a/app/Http/Requests/MicropubRequest.php b/app/Http/Requests/MicropubRequest.php index d931f139..41c70280 100644 --- a/app/Http/Requests/MicropubRequest.php +++ b/app/Http/Requests/MicropubRequest.php @@ -51,7 +51,7 @@ class MicropubRequest extends FormRequest // Convert JSON type (h-entry) to simple type (entry) if (isset($data['type']) && is_array($data['type'])) { $type = current($data['type']); - if (strpos($type, 'h-') === 0) { + if (str_starts_with($type, 'h-')) { $this->micropubData['type'] = substr($type, 2); } } @@ -67,7 +67,7 @@ class MicropubRequest extends FormRequest $this->micropubData['content'] = Arr::get($data, 'properties.content.0'); $this->micropubData['in-reply-to'] = Arr::get($data, 'properties.in-reply-to.0'); $this->micropubData['published'] = Arr::get($data, 'properties.published.0'); - $this->micropubData['location'] = Arr::get($data, 'location'); + $this->micropubData['location'] = $this->getLocationData($data); $this->micropubData['bookmark-of'] = Arr::get($data, 'properties.bookmark-of.0'); $this->micropubData['like-of'] = Arr::get($data, 'properties.like-of.0'); $this->micropubData['mp-syndicate-to'] = Arr::get($data, 'properties.mp-syndicate-to'); @@ -103,4 +103,17 @@ class MicropubRequest extends FormRequest $this->micropubData[$key] = $value; } } + + private function getLocationData(array $data): array|string|null + { + if (! Arr::has($data, 'properties.location')) { + return null; + } + + if (Arr::has($data, 'properties.location.0')) { + return Arr::get($data, 'properties.location.0'); + } + + return Arr::get($data, 'properties.location'); + } } diff --git a/docker-compose.yml b/docker-compose.yml index cd9242e8..74f97af5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,7 +6,7 @@ services: dockerfile: Dockerfile args: WWWGROUP: '${WWWGROUP}' - image: sail-8.3/app + image: sail-8.4/app extra_hosts: - 'host.docker.internal:host-gateway' ports: diff --git a/resources/views/admin/clients/index.blade.php b/resources/views/admin/clients/index.blade.php index df731b5c..a99937b5 100644 --- a/resources/views/admin/clients/index.blade.php +++ b/resources/views/admin/clients/index.blade.php @@ -13,6 +13,6 @@ @endforeach
- Create a new entry? + Create a new entry?
@stop diff --git a/resources/views/login.blade.php b/resources/views/login.blade.php index b80bd147..65da9813 100644 --- a/resources/views/login.blade.php +++ b/resources/views/login.blade.php @@ -3,8 +3,8 @@ @section('content')