8000 fix(Locker): don't store transport-options.ssl within the lock-file by rtm-ctrlz · Pull Request #12019 · composer/composer · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix(Locker): don't store transport-options.ssl within the lock-file #12019

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/Composer/Package/Locker.php
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,14 @@ private function lockPackages(array $packages): array

$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'])) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: you don't need to check with isset if transport-options is set first, then ssl, you can do both at once, isset($random->deep['garbage']['not']->existing); works fine :) https://3v4l.org/UAaJW

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;
Expand Down
Loading
0