cvs: pear-core /PEAR/PackageFile/v2 Validator.php
| From: | Greg Beaver | Date: | Sun, 02 Oct 2005 20:06:53 +0000 |
| Subject: | cvs: pear-core /PEAR/PackageFile/v2 Validator.php | ||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-cvs+get-35230@lists.php.net to get a copy of this message | ||
cellog Sun Oct 2 16:06:53 2005 EDT
Modified files:
/pear-core/PEAR/PackageFile/v2 Validator.php
Log:
fix <compatible> validation in PHP 5.0.5
# ANOTHER BC break in PHP?! isset() does not work
# for array indices any longer
http://cvs.php.net/diff.php/pear-core/PEAR/PackageFile/v2/Validator.php?r1=1.73&r2=1.74&ty=u
Index: pear-core/PEAR/PackageFile/v2/Validator.php
diff -u pear-core/PEAR/PackageFile/v2/Validator.php:1.73
pear-core/PEAR/PackageFile/v2/Validator.php:1.74
--- pear-core/PEAR/PackageFile/v2/Validator.php:1.73 Sun Sep 25 13:26:05 2005
+++ pear-core/PEAR/PackageFile/v2/Validator.php Sun Oct 2 16:06:49 2005
@@ -17,7 +17,7 @@
// | |
// +----------------------------------------------------------------------+
//
-// $Id: Validator.php,v 1.73 2005/09/25 17:26:05 cellog Exp $
+// $Id: Validator.php,v 1.74 2005/10/02 20:06:49 cellog Exp $
/**
* Private validation class used by PEAR_PackageFile_v2 - do not use directly, its
* sole purpose is to split up the PEAR/PackageFile/v2.php file to make it smaller
@@ -891,23 +891,23 @@
$required = array('name', 'channel', 'min', 'max',
'*exclude');
foreach ($compat as $package) {
$type = '<compatible>';
- if (isset($package['name'])) {
+ if (is_array($package) && array_key_exists('name', $package)) {
$type .= '<name>' . $package['name'] .
'</name>';
}
$this->_stupidSchemaValidate($required, $package, $type);
- if (isset($package['min'])) {
+ if (is_array($package) && array_key_exists('min', $package)) {
if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?$/',
$package['min'])) {
$this->_invalidVersion(substr($type, 1) . '<min',
$package['min']);
}
}
- if (isset($package['max'])) {
+ if (is_array($package) && array_key_exists('max', $package)) {
if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?$/',
$package['max'])) {
$this->_invalidVersion(substr($type, 1) . '<max',
$package['max']);
}
}
- if (isset($package['exclude'])) {
+ if (is_array($package) && array_key_exists('exclude', $package)) {
if (!is_array($package['exclude'])) {
$package['exclude'] = array($package['exclude']);
}