cvs: pear-core /PEAR/PackageFile/v2 Validator.php
| From: | Greg Beaver | Date: | Tue, 21 Nov 2006 03:17:17 +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-5201@lists.php.net to get a copy of this message | ||
cellog Tue Nov 21 03:17:17 2006 UTC
Modified files:
/pear-core/PEAR/PackageFile/v2 Validator.php
Log:
fully fix #9307
http://cvs.php.net/viewvc.cgi/pear-core/PEAR/PackageFile/v2/Validator.php?r1=1.95&r2=1.96&diff_format=u
Index: pear-core/PEAR/PackageFile/v2/Validator.php
diff -u pear-core/PEAR/PackageFile/v2/Validator.php:1.95
pear-core/PEAR/PackageFile/v2/Validator.php:1.96
--- pear-core/PEAR/PackageFile/v2/Validator.php:1.95 Sun Nov 12 16:59:52 2006
+++ pear-core/PEAR/PackageFile/v2/Validator.php Tue Nov 21 03:17:17 2006
@@ -17,7 +17,7 @@
// | |
// +----------------------------------------------------------------------+
//
-// $Id: Validator.php,v 1.95 2006/11/12 16:59:52 cellog Exp $
+// $Id: Validator.php,v 1.96 2006/11/21 03:17:17 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
@@ -174,6 +174,9 @@
$this->_validateCompatible();
}
if (!isset($this->_packageInfo['bundle'])) {
+ if (empty($this->_packageInfo['contents'])) {
+ $this->_tagCannotBeEmpty('contents');
+ }
if (!isset($this->_packageInfo['contents']['dir'])) {
$this->_filelistMustContainDir('contents');
return false;
@@ -1728,8 +1731,9 @@
$log = isset($this->_pf->_logger) ? array(&$this->_pf->_logger,
'log') :
array(&$common, 'log');
$info = $this->_pf->getContents();
- if (!$info) {
- $this->_tagCannotBeEmpty('contents');
+ if (!$info || !isset($info['dir']['file'])) {
+ $this->_tagCannotBeEmpty('contents><dir');
+ return false;
}
$info = $info['dir']['file'];
if (isset($info['attribs'])) {