Re: XML Expat in 4.0.4
| From: | Thies C. Arntzen | Date: | Mon, 25 Dec 2000 14:13:27 +0000 |
| Subject: | Re: XML Expat in 4.0.4 | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-4651@lists.php.net to get a copy of this message | ||
On Mon, Dec 25, 2000 at 01:22:18PM +0100, Florian Clever wrote:
> Hi,
>
> I am unable to get the Expat Parser working in PHP 4.0.4. It is all working
> perfectly fine in PHP 4.0.3pl1.
>
> I always get PHP encountered Access violation in the line with
> "xml_parse($xmlparser, $xml_tpl, true)".
this is fixed in the lastest CVS.
please apply the attached patch:
cd php-4.0.4
patch < ~/call_user_function.patch
and recompile.
regards,
tc
>
> This is the test script.
> <?php
> function XmlTplStartElement( $xmlparserObj, $ele_name, $attribs) {
> print "<" . $ele_name . ">";
> }
> function XmlTplEndElement($xmlparserObj, $ele_name) {
> print "</" . $ele_name . ">";
> }
> function XmlTplCharData( $xmlparserObj, $chardata) {
> print $chardata;
> }
>
> $xmlparser = xml_parser_create();
> xml_parser_set_option ($xmlparser, XML_OPTION_CASE_FOLDING, false);
> xml_set_element_handler( $xmlparser, "XmlTplStartElement",
> "XmlTplEndElement");
> xml_set_character_data_handler( $xmlparser, "XmlTplCharData");
>
> $xml_tpl =
> "<root><ele><subele>subele1</subele></ele><p>Text1</p></root>";
>
> if ( ! (xml_parse($xmlparser, $xml_tpl, true) ) ) {
> print "<font size=\"+2\" color=\"#FF0000\"><b>XML error:
> " .
> xml_error_string(xml_get_error_code($xmlparser)) . " at line " .
> xml_get_current_line_number($xmlparser) . "</b></font>\n";
> }
>
> xml_parser_free( $xmlparser );
>
> ?>
>
> thanks Florian
>
> Florian Clever
>
> fc@clever-soft.com
> http://www.Clever-Software-Solutions.de/
>
> PGP Key @ ldap://certserver.pgp.net/
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
> For additional commands, e-mail: php-windows-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>
>
Index: Zend/zend_execute_API.c =================================================================== RCS file: /repository/Zend/zend_execute_API.c,v retrieving revision 1.109 retrieving revision 1.110 diff -u -r1.109 -r1.110 --- Zend/zend_execute_API.c 2000/12/23 12:54:42 1.109 +++ Zend/zend_execute_API.c 2000/12/24 00:29:14 1.110 @@ -361,6 +361,9 @@ (*object_pp)->is_ref = 1; } + if (object_pp && !*object_pp) { + object_pp = NULL; + } if (object_pp) { if (Z_TYPE_PP(object_pp) != IS_OBJECT) { return FAILURE;
Index: Zend/zend_execute_API.c =================================================================== RCS file: /repository/Zend/zend_execute_API.c,v retrieving revision 1.109 retrieving revision 1.110 diff -u -r1.109 -r1.110 --- Zend/zend_execute_API.c 2000/12/23 12:54:42 1.109 +++ Zend/zend_execute_API.c 2000/12/24 00:29:14 1.110 @@ -361,6 +361,9 @@ (*object_pp)->is_ref = 1; } + if (object_pp && !*object_pp) { + object_pp = NULL; + } if (object_pp) { if (Z_TYPE_PP(object_pp) != IS_OBJECT) { return FAILURE;