From: Tomas V.V.Cox Date: Thu, 19 Jul 2001 10:32:06 +0000 (+0000) Subject: added TODO and checks before try to open the package.xml file X-Git-Tag: PRE_TSRM_MERGE_PATCH~78 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0d629b854ad3eb8cca3ec974b66bd9b4c25c8a44;p=php added TODO and checks before try to open the package.xml file --- 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');