Only allow platform packages to be overridden.
As defined by the PlatformRepository::PLATFORM_PACKAGE_REGEX pattern.pull/2990/head
parent
571363dee2
commit
ac89a5bb3b
|
@ -41,11 +41,17 @@ class PlatformRepository extends ArrayRepository
|
|||
// Add each of the override versions as options.
|
||||
// Later we might even replace the extensions instead.
|
||||
foreach( $this->overrides as $name => $prettyVersion ) {
|
||||
// Check that it's a platform package.
|
||||
if( preg_match(self::PLATFORM_PACKAGE_REGEX, $name) ) {
|
||||
$version = $versionParser->normalize($prettyVersion);
|
||||
$package = new CompletePackage($name, $version, $prettyVersion);
|
||||
$package->setDescription("Overridden virtual platform package $name.");
|
||||
parent::addPackage($package);
|
||||
}
|
||||
else {
|
||||
throw new \UnexpectedValueException('Invalid platform package "'.$name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$prettyVersion = PluginInterface::PLUGIN_API_VERSION;
|
||||
|
|
Loading…
Reference in New Issue