From 17d348368c68ca00e9d10696efd9d47b4fc7d73b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Rancoud?= Date: Sat, 30 May 2026 02:11:08 +0200 Subject: [PATCH 1/4] chore: add php 8.5 to tests --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f0cf1d1..bc61477 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,6 +26,7 @@ jobs: - ubuntu-latest php-version: - '8.4' + - '8.5' steps: - name: Checkout From e13ca487b9467b1b6bd6a7fd0e685fcdb2c62089 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Rancoud?= Date: Sat, 30 May 2026 03:29:26 +0200 Subject: [PATCH 2/4] update about deprecated --- src/Security.php | 7 ++++++- tests/SecurityTest.php | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Security.php b/src/Security.php index 18f81bc..afbd09a 100644 --- a/src/Security.php +++ b/src/Security.php @@ -156,7 +156,12 @@ public static function escAttr(mixed $text, string $charset = 'UTF-8'): string $text = \preg_replace_callback('/[^a-z0-9,.\-_]/iSu', static function ($matches) { $chr = $matches[0]; - $ord = \ord($chr); + + if (\strlen($chr) === 1) { + $ord = \ord($chr); + } else { + $ord = \mb_ord($chr, 'UTF-8'); + } if (($ord <= 0x1F && $chr !== "\t" && $chr !== "\n" && $chr !== "\r") || ($ord >= 0x7F && $ord <= 0x9F) diff --git a/tests/SecurityTest.php b/tests/SecurityTest.php index 9328d34..7b0ff13 100644 --- a/tests/SecurityTest.php +++ b/tests/SecurityTest.php @@ -426,7 +426,7 @@ public function testCharsetNotSupportedException(): void public function testInvalidCharacter(): void { - $invalidChar = \chr(99999999); + $invalidChar = "\xFF"; $countThrownExceptions = 0; try { From 604376620782c0bf6776b842a7ad5fa10bcdbaad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Rancoud?= Date: Sat, 30 May 2026 21:56:35 +0200 Subject: [PATCH 3/4] updates --- .github/workflows/test.yml | 12 +++++++----- composer.json | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bc61477..c62d956 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,12 +8,13 @@ concurrency: cancel-in-progress: true on: - push: - paths-ignore: - - '**.md' pull_request: paths-ignore: - '**.md' + types: + - opened + - synchronize + - reopened jobs: test: @@ -56,12 +57,13 @@ jobs: run: composer install --prefer-dist --no-progress - name: Lint + if: matrix.php-version == '8.4' run: | - PHP_CS_FIXER_IGNORE_ENV=True vendor/bin/php-cs-fixer fix --diff --dry-run + vendor/bin/php-cs-fixer fix --diff --dry-run - name: PHPUnit run: | - vendor/bin/phpunit --colors --coverage-text --coverage-clover coverage/clover.xml + vendor/bin/phpunit --colors --display-deprecation --coverage-text --coverage-clover coverage/clover.xml - name: Upload coverage uses: codecov/codecov-action@v6 diff --git a/composer.json b/composer.json index 8792db6..bca6c18 100644 --- a/composer.json +++ b/composer.json @@ -37,7 +37,7 @@ "php-cs-fixer fix -vvv" ], "test": [ - "phpunit --colors --coverage-html ./coverage" + "phpunit --colors --display-deprecation --coverage-html ./coverage" ] } } From a72f3609f3d2039ace6a31105fc16a37e2cedd19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Rancoud?= Date: Sat, 30 May 2026 23:26:50 +0200 Subject: [PATCH 4/4] use --display-all-issues --- .github/workflows/test.yml | 2 +- composer.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c62d956..d98749b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -63,7 +63,7 @@ jobs: - name: PHPUnit run: | - vendor/bin/phpunit --colors --display-deprecation --coverage-text --coverage-clover coverage/clover.xml + vendor/bin/phpunit --colors --display-all-issues --coverage-text --coverage-clover coverage/clover.xml - name: Upload coverage uses: codecov/codecov-action@v6 diff --git a/composer.json b/composer.json index bca6c18..753c714 100644 --- a/composer.json +++ b/composer.json @@ -37,7 +37,7 @@ "php-cs-fixer fix -vvv" ], "test": [ - "phpunit --colors --display-deprecation --coverage-html ./coverage" + "phpunit --colors --display-all-issues --coverage-html ./coverage" ] } }