cvs: pear-core /PEAR/PackageFile/v2 Validator.php
| From: | Greg Beaver | Date: | Sun, 21 Aug 2005 05:24:32 +0000 |
| Subject: | cvs: pear-core /PEAR/PackageFile/v2 Validator.php | ||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-core+get-3677@lists.php.net to get a copy of this message | ||
cellog Sun Aug 21 01:24:32 2005 EDT
Modified files:
/pear-core/PEAR/PackageFile/v2 Validator.php
Log:
fix *major* logic flaw in prevention of validation error based
on <dir>/<file> order in package.xml 2.0
# thank you unit tests
http://cvs.php.net/diff.php/pear-core/PEAR/PackageFile/v2/Validator.php?r1=1.70&r2=1.71&ty=u
Index: pear-core/PEAR/PackageFile/v2/Validator.php
diff -u pear-core/PEAR/PackageFile/v2/Validator.php:1.70
pear-core/PEAR/PackageFile/v2/Validator.php:1.71
--- pear-core/PEAR/PackageFile/v2/Validator.php:1.70 Sun Aug 14 02:49:24 2005
+++ pear-core/PEAR/PackageFile/v2/Validator.php Sun Aug 21 01:24:31 2005
@@ -17,7 +17,7 @@
// | |
// +----------------------------------------------------------------------+
//
-// $Id: Validator.php,v 1.70 2005/08/14 06:49:24 cellog Exp $
+// $Id: Validator.php,v 1.71 2005/08/21 05:24:31 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
@@ -955,7 +955,12 @@
);
if (isset($list['dir']) && isset($list['file'])) {
// stave off validation errors without requiring a set order.
- $list = array('dir' => $list['dir'],
$list['file']);
+ $_old = $list;
+ if (isset($list['attribs'])) {
+ $list = array('attribs' => $_old['attribs']);
+ }
+ $list['dir'] = $_old['dir'];
+ $list['file'] = $_old['file'];
}
}
if (!isset($list['attribs']) ||
!isset($list['attribs']['name'])) {