From: Greg Beaver Date: Tue, 2 Sep 2003 03:15:27 +0000 (+0000) Subject: if a package.xml is passed to InfoFrom*(), and the package version is invalid, curren... X-Git-Tag: RELEASE_0_7~293 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=92341f79bef153b63712ed472782c799c5b749c1;p=php if a package.xml is passed to InfoFrom*(), and the package version is invalid, current CVS causes a whole bunch of xml parser warnings and craps out without telling the user why. Now it exits gracefully. --- diff --git a/pear/PEAR/Common.php b/pear/PEAR/Common.php index 51697e5875..f34b25f8c3 100644 --- a/pear/PEAR/Common.php +++ b/pear/PEAR/Common.php @@ -332,6 +332,11 @@ class PEAR_Common extends PEAR $elem_start = '_element_start_'. $vs; $elem_end = '_element_end_'. $vs; $cdata = '_pkginfo_cdata_'. $vs; + if (!method_exists($this, $elem_start) || + !method_exists($this, $elem_end) || + !method_exists($this, $cdata)) { + $this->raiseError("No handlers for package.xml version $attribs[version]"); + } xml_set_element_handler($xp, $elem_start, $elem_end); xml_set_character_data_handler($xp, $cdata); break;