From 0d629b854ad3eb8cca3ec974b66bd9b4c25c8a44 Mon Sep 17 00:00:00 2001 From: "Tomas V.V.Cox" Date: Thu, 19 Jul 2001 10:32:06 +0000 Subject: [PATCH] added TODO and checks before try to open the package.xml file --- pear/PEAR/Common.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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'); -- 2.50.1