summaryrefslogtreecommitdiff
path: root/pear
diff options
context:
space:
mode:
authorTomas V.V.Cox <cox@php.net>2001-07-19 10:32:06 +0000
committerTomas V.V.Cox <cox@php.net>2001-07-19 10:32:06 +0000
commit0d629b854ad3eb8cca3ec974b66bd9b4c25c8a44 (patch)
tree0678d1fc7296cca95f1ecfe6748b1fa1b132388b /pear
parentdfe15ad070efde477d39babc92ca2f8903daaf79 (diff)
downloadphp-git-0d629b854ad3eb8cca3ec974b66bd9b4c25c8a44.tar.gz
added TODO and checks before try to open the package.xml file
Diffstat (limited to 'pear')
-rw-r--r--pear/PEAR/Common.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/pear/PEAR/Common.php b/pear/PEAR/Common.php
index 50d37e3aef..460e210838 100644
--- a/pear/PEAR/Common.php
+++ b/pear/PEAR/Common.php
@@ -17,9 +17,17 @@
// | |
// +----------------------------------------------------------------------+
//
+// $Id$
require_once 'PEAR.php';
+/**
+* TODO:
+* - check in inforFromDescFile that the minimal data needed is present
+* (pack name, version, files, others?)
+* - perhaps use parser folding to be less restrictive with the format
+ of the package.xml file
+*/
class PEAR_Common extends PEAR
{
// {{{ properties
@@ -247,7 +255,10 @@ class PEAR_Common extends PEAR
function infoFromDescriptionFile($descfile)
{
- $fp = fopen($descfile, 'r');
+ if (!is_file($descfile) || !is_readable($descfile) ||
+ (!$fp = @fopen($descfile, 'r'))) {
+ return $this->raiseError("Unable to open $descfile");
+ }
$xp = @xml_parser_create();
if (!$xp) {
return $this->raiseError('Unable to create XML parser');