From f01ec4a98fe5b0516588dde6d76b4b3ac2f0d1cd Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 3 Apr 2024 10:36:39 +0200 Subject: [PATCH] Ensure integer env vars do not cause a crash, fixes #11908 --- src/Composer/Factory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Factory.php b/src/Composer/Factory.php index 03a5fa2ae..0d455b7e3 100644 --- a/src/Composer/Factory.php +++ b/src/Composer/Factory.php @@ -681,7 +681,7 @@ class Factory private static function useXdg(): bool { foreach (array_keys($_SERVER) as $key) { - if (strpos($key, 'XDG_') === 0) { + if (strpos((string) $key, 'XDG_') === 0) { return true; } }