mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-10-27 16:26:32 +01:00
Properly exit the nested foreach when a matching dependency is found
This commit is contained in:
@@ -1609,16 +1609,16 @@ class Admin
|
|||||||
foreach ($notification['dependencies'] as $dependency => $constraints) {
|
foreach ($notification['dependencies'] as $dependency => $constraints) {
|
||||||
if ($dependency === 'grav') {
|
if ($dependency === 'grav') {
|
||||||
if (!Semver::satisfies(GRAV_VERSION, $constraints)) {
|
if (!Semver::satisfies(GRAV_VERSION, $constraints)) {
|
||||||
continue;
|
continue 2;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$packages = array_merge($this->plugins()->toArray(), $this->themes()->toArray());
|
$packages = array_merge($this->plugins()->toArray(), $this->themes()->toArray());
|
||||||
if (!isset($packages[$dependency])) {
|
if (!isset($packages[$dependency])) {
|
||||||
continue;
|
continue 2;
|
||||||
} else {
|
} else {
|
||||||
$version = $packages[$dependency]['version'];
|
$version = $packages[$dependency]['version'];
|
||||||
if (!Semver::satisfies($version, $constraints)) {
|
if (!Semver::satisfies($version, $constraints)) {
|
||||||
continue;
|
continue 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user