From efc105eac143d961bef5f6bea3c6190187266749 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C5=A0pa=C4=8Dek?= Date: Mon, 27 Feb 2023 16:02:50 +0100 Subject: [PATCH 1/2] Add proxy value to bin-compat validator (#11353) Fix #11352 --- src/Composer/Command/ConfigCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Command/ConfigCommand.php b/src/Composer/Command/ConfigCommand.php index 952baa815..d7f4ad78a 100644 --- a/src/Composer/Command/ConfigCommand.php +++ b/src/Composer/Command/ConfigCommand.php @@ -413,7 +413,7 @@ EOT ], 'bin-compat' => [ static function ($val): bool { - return in_array($val, ['auto', 'full', 'symlink']); + return in_array($val, ['auto', 'full', 'proxy', 'symlink']); }, static function ($val) { return $val; From b8f82b244c930753794366dbf70f803cf5d699cc Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 15 Mar 2023 22:53:29 +0100 Subject: [PATCH 2/2] Escape % chars in user input before passing to sprintf, fixes #11359 --- src/Composer/DependencyResolver/Problem.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Composer/DependencyResolver/Problem.php b/src/Composer/DependencyResolver/Problem.php index 0cb314401..5dfeb18c8 100644 --- a/src/Composer/DependencyResolver/Problem.php +++ b/src/Composer/DependencyResolver/Problem.php @@ -115,6 +115,7 @@ class Problem foreach ($rules as $rule) { $message = $rule->getPrettyString($repositorySet, $request, $pool, $isVerbose, $installedMap, $learnedPool); if (in_array($rule->getReason(), $deduplicatableRuleTypes, true) && Preg::isMatchStrictGroups('{^(?P\S+) (?P\S+) (?Prequires|conflicts)}', $message, $m)) { + $message = str_replace('%', '%%', $message); $template = Preg::replace('{^\S+ \S+ }', '%s%s ', $message); $messages[] = $template; $templates[$template][$m[1]][$parser->normalize($m[2])] = $m[2];