From 03bbfdd8f4d6ce3c0678b6cba26446704b4d594b Mon Sep 17 00:00:00 2001 From: Ilya Urvachev Date: Wed, 10 Jul 2024 10:35:26 +0200 Subject: [PATCH] fix(Locker): don't store transport-options.ssl within the lock-file (#12019) --- src/Composer/Package/Locker.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Composer/Package/Locker.php b/src/Composer/Package/Locker.php index f832e797c..6c3dfa604 100644 --- a/src/Composer/Package/Locker.php +++ b/src/Composer/Package/Locker.php @@ -431,6 +431,14 @@ class Locker $spec = $this->dumper->dump($package); unset($spec['version_normalized']); + // remove `transport-options.ssl` from lock file to prevent storing + // local-filesystem repo config paths in the lock file as that makes it less portable + if (isset($spec['transport-options']['ssl'])) { + unset($spec['transport-options']['ssl']); + if (\count($spec['transport-options']) === 0) { + unset($spec['transport-options']); + } + } // always move time to the end of the package definition $time = $spec['time'] ?? null;