mirror of
https://github.com/php/php-src.git
synced 2025-08-20 01:14:28 +02:00
fix bug #1610: pear package doesn't validate deps
It was never validating deps at all!
This commit is contained in:
parent
9873fa5e42
commit
22fa023c88
1 changed files with 5 additions and 5 deletions
|
@ -1115,24 +1115,24 @@ class PEAR_Common extends PEAR
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!empty($info['deps'])) {
|
if (!empty($info['release_deps'])) {
|
||||||
$i = 1;
|
$i = 1;
|
||||||
foreach ($info['deps'] as $d) {
|
foreach ($info['release_deps'] as $d) {
|
||||||
if (empty($d['type'])) {
|
if (empty($d['type'])) {
|
||||||
$errors[] = "dependency $i: missing type";
|
$errors[] = "dependency $i: missing type";
|
||||||
} elseif (!in_array($d['type'], PEAR_Common::getDependencyTypes())) {
|
} elseif (!in_array($d['type'], PEAR_Common::getDependencyTypes())) {
|
||||||
$errors[] = "dependency $i: invalid type, should be one of: " .
|
$errors[] = "dependency $i: invalid type '$d[type]', should be one of: " .
|
||||||
implode(' ', PEAR_Common::getDependencyTypes());
|
implode(' ', PEAR_Common::getDependencyTypes());
|
||||||
}
|
}
|
||||||
if (empty($d['rel'])) {
|
if (empty($d['rel'])) {
|
||||||
$errors[] = "dependency $i: missing relation";
|
$errors[] = "dependency $i: missing relation";
|
||||||
} elseif (!in_array($d['rel'], PEAR_Common::getDependencyRelations())) {
|
} elseif (!in_array($d['rel'], PEAR_Common::getDependencyRelations())) {
|
||||||
$errors[] = "dependency $i: invalid relation, should be one of: "
|
$errors[] = "dependency $i: invalid relation '$d[rel]', should be one of: "
|
||||||
. implode(' ', PEAR_Common::getDependencyRelations());
|
. implode(' ', PEAR_Common::getDependencyRelations());
|
||||||
}
|
}
|
||||||
if (!empty($d['optional'])) {
|
if (!empty($d['optional'])) {
|
||||||
if (!in_array($d['optional'], array('yes', 'no'))) {
|
if (!in_array($d['optional'], array('yes', 'no'))) {
|
||||||
$errors[] = "dependency $i: invalid relation optional attribute, should be one of: yes no";
|
$errors[] = "dependency $i: invalid relation optional attribute '$d[optional]', should be one of: yes no";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($d['rel'] != 'has' && empty($d['version'])) {
|
if ($d['rel'] != 'has' && empty($d['version'])) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue