From 0a94017d6758ba9670330220073f1a5c57d33968 Mon Sep 17 00:00:00 2001 From: David Jardin Date: Mon, 20 Oct 2025 11:53:30 +0200 Subject: [PATCH 1/3] limit body length --- .github/workflows/pint.yaml | 2 +- .github/workflows/stan.yaml | 2 +- .github/workflows/tests.yaml | 2 +- Dockerfile | 2 +- bootstrap/app.php | 3 ++- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pint.yaml b/.github/workflows/pint.yaml index 65823c1..1577081 100644 --- a/.github/workflows/pint.yaml +++ b/.github/workflows/pint.yaml @@ -12,7 +12,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.4' + php-version: '8.3' extensions: pcntl, curl, pdo_mysql, zip, curl, redis coverage: none diff --git a/.github/workflows/stan.yaml b/.github/workflows/stan.yaml index 3c484bd..b42f76b 100644 --- a/.github/workflows/stan.yaml +++ b/.github/workflows/stan.yaml @@ -12,7 +12,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.4' + php-version: '8.3' coverage: none - name: Install composer dependencies diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 665405a..ff5cf96 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -12,7 +12,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.4' + php-version: '8.3' extensions: pcntl, curl, pdo_mysql, zip, curl, redis coverage: none diff --git a/Dockerfile b/Dockerfile index 69be01b..6fbf3a6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM dunglas/frankenphp:php8.4 +FROM dunglas/frankenphp:php8.3 ARG UID ARG GID diff --git a/bootstrap/app.php b/bootstrap/app.php index 44719fe..ec14bc1 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -7,6 +7,7 @@ use Illuminate\Foundation\Configuration\Middleware; use Illuminate\Foundation\Http\Middleware\ValidateCsrfToken; use Illuminate\Session\Middleware\StartSession; +use Illuminate\Support\Str; use Illuminate\Support\Facades\Log; use Illuminate\View\Middleware\ShareErrorsFromSession; @@ -33,7 +34,7 @@ Log::warning('HTTP Request Exception', [ 'url' => (string) $e->getRequest()->getUri(), 'status' => $e->getResponse()->getStatusCode(), - 'body' => $e->getResponse()->getBody(), + 'body' => Str::of((string) $e->getResponse()->getBody())->substr(0, 250) ]); })->stop(); })->create(); From 13bcd06a6651792a7fa271763d1663f11f3d3218 Mon Sep 17 00:00:00 2001 From: David Jardin Date: Mon, 20 Oct 2025 11:58:14 +0200 Subject: [PATCH 2/3] fix php version --- composer.json | 2 +- composer.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 52bfc09..ffe5215 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,7 @@ "keywords": ["laravel", "framework"], "license": "MIT", "require": { - "php": "^8.4", + "php": "^8.3", "guzzlehttp/guzzle": "^7.9.3", "laravel/framework": "^11.46", "laravel/horizon": "^5.29", diff --git a/composer.lock b/composer.lock index 0e26300..3303127 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ae704396017273cf55df5165093276ae", + "content-hash": "8310accfdfcc44422cfbe3aac4734de2", "packages": [ { "name": "brick/math", @@ -9141,7 +9141,7 @@ "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": "^8.4" + "php": "^8.3" }, "platform-dev": {}, "plugin-api-version": "2.6.0" From 4883c1ab771c957d40fc4ff86354da3e92c97a66 Mon Sep 17 00:00:00 2001 From: David Jardin Date: Mon, 20 Oct 2025 12:10:13 +0200 Subject: [PATCH 3/3] use native substr --- bootstrap/app.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bootstrap/app.php b/bootstrap/app.php index ec14bc1..5ecd672 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -7,7 +7,6 @@ use Illuminate\Foundation\Configuration\Middleware; use Illuminate\Foundation\Http\Middleware\ValidateCsrfToken; use Illuminate\Session\Middleware\StartSession; -use Illuminate\Support\Str; use Illuminate\Support\Facades\Log; use Illuminate\View\Middleware\ShareErrorsFromSession; @@ -34,7 +33,7 @@ Log::warning('HTTP Request Exception', [ 'url' => (string) $e->getRequest()->getUri(), 'status' => $e->getResponse()->getStatusCode(), - 'body' => Str::of((string) $e->getResponse()->getBody())->substr(0, 250) + 'body' => substr((string) $e->getResponse()->getBody(), 0, 250) ]); })->stop(); })->create();