From 55f385450407a3d8c6c7c90ec4dc8995f5277a94 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 15 Aug 2026 07:50:54 +0900 Subject: fix(phar): match the stub token in any letter case `__halt_compiler` is a PHP keyword, so a stub may spell the token in any letter case. The native phar reader compared the bytes exactly and rejected such an archive, and the lint that keeps a second token out of the executable missed lowercase ones, which would shadow the embedded bundle. Co-Authored-By: Claude Opus 5 (1M context) --- scripts/linters/src/Linters/NoHaltCompilerLiteral.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts/linters/src/Linters/NoHaltCompilerLiteral.php') diff --git a/scripts/linters/src/Linters/NoHaltCompilerLiteral.php b/scripts/linters/src/Linters/NoHaltCompilerLiteral.php index 30520ff7..30160886 100644 --- a/scripts/linters/src/Linters/NoHaltCompilerLiteral.php +++ b/scripts/linters/src/Linters/NoHaltCompilerLiteral.php @@ -20,7 +20,7 @@ final class NoHaltCompilerLiteral implements Linter public function failureIntro(): string { - return "Found a literal `" . self::TOKEN . "`.\n" + return "Found a literal `" . self::TOKEN . "` (case-insensitive).\n" . "The executable carries the Composer runtime bundle as a phar that PHP finds by\n" . "scanning for the first occurrence of that token, and every literal here ends up in\n" . "the same binary, so an earlier one shadows the bundle. Build the token at run time\n" @@ -39,7 +39,7 @@ final class NoHaltCompilerLiteral implements Linter } foreach (file($path) as $idx => $raw) { - if (!str_contains($raw, self::TOKEN)) { + if (stripos($raw, self::TOKEN) === false) { continue; } -- cgit v1.3.1-4-g156e