Skip to content

Commit

Permalink
Ensure env vars and ~ prefix cannot be used, refs composer/composer#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed May 5, 2023
1 parent 6bedbca commit 6246e90
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Entity/Package.php
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,11 @@ public function setRepository(string $repoUrl): void
return;
}

// block env vars & ~ prefixes
if (Preg::isMatch('{^[%$~]}', $repoUrl)) {
return;
}

try {
$io = new NullIO();
$config = Factory::createConfig();
Expand Down

0 comments on commit 6246e90

Please sign in to comment.