cvs: pear /XML_Parser Parser.php package.php
| From: | Stephan Schmidt | Date: | Tue, 04 Oct 2005 11:17:38 +0000 |
| Subject: | cvs: pear /XML_Parser Parser.php package.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-35259@lists.php.net to get a copy of this message | ||
schst Tue Oct 4 07:17:38 2005 EDT
Modified files:
/pear/XML_Parser Parser.php package.php
Log:
fixed bug #5557: Raise a more useful error message when using invalid source encoding
http://cvs.php.net/diff.php/pear/XML_Parser/Parser.php?r1=1.26&r2=1.27&ty=u
Index: pear/XML_Parser/Parser.php
diff -u pear/XML_Parser/Parser.php:1.26 pear/XML_Parser/Parser.php:1.27
--- pear/XML_Parser/Parser.php:1.26 Fri Sep 23 07:51:10 2005
+++ pear/XML_Parser/Parser.php Tue Oct 4 07:17:36 2005
@@ -18,7 +18,7 @@
// | Stephan Schmidt <schst@php-tools.net> |
// +----------------------------------------------------------------------+
//
-// $Id: Parser.php,v 1.26 2005/09/23 11:51:10 schst Exp $
+// $Id: Parser.php,v 1.27 2005/10/04 11:17:36 schst Exp $
/**
* XML Parser class.
@@ -164,6 +164,13 @@
*/
var $_handlerObj;
+ /**
+ * valid encodings
+ *
+ * @var array
+ */
+ var $_validEncodings = array('ISO-8859-1', 'UTF-8', 'US-ASCII');
+
// }}}
// {{{ constructor
@@ -332,9 +339,11 @@
return $result;
}
xml_parser_set_option($xp, XML_OPTION_CASE_FOLDING, $this->folding);
-
return true;
}
+ if (!in_array(strtoupper($this->srcenc), $this->_validEncodings)) {
+ return $this->raiseError('invalid source encoding',
XML_PARSER_ERROR_INVALID_ENCODING);
+ }
return $this->raiseError('Unable to create XML parser resource.',
XML_PARSER_ERROR_NO_RESOURCE);
}
http://cvs.php.net/diff.php/pear/XML_Parser/package.php?r1=1.19&r2=1.20&ty=u
Index: pear/XML_Parser/package.php
diff -u pear/XML_Parser/package.php:1.19 pear/XML_Parser/package.php:1.20
--- pear/XML_Parser/package.php:1.19 Sat Sep 24 11:11:57 2005
+++ pear/XML_Parser/package.php Tue Oct 4 07:17:36 2005
@@ -3,7 +3,7 @@
* script to automate the generation of the
* package.xml file.
*
- * $Id: package.php,v 1.19 2005/09/24 15:11:57 schst Exp $
+ * $Id: package.php,v 1.20 2005/10/04 11:17:36 schst Exp $
*
* @author Stephan Schmidt <schst@php-tools.net>
* @package XML_Parser
@@ -18,7 +18,7 @@
/**
* current version
*/
-$version = '1.2.7';
+$version = '1.2.8';
/**
* current state
@@ -29,7 +29,7 @@
* release notes
*/
$notes = <<<EOT
-- implemented request #4774: Error message contains column number
+- fixed bug #5557: Raise a more useful error message when using invalid source encoding
EOT;
/**