From: Rob Richards Date: Sat, 6 Jan 2007 18:03:15 +0000 (+0000) Subject: parameter entity argument (pe) should be bool X-Git-Tag: RELEASE_1_0_0RC1~379 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=05a532c07a8e2bf63ca041f98e9b123eb09333ff;p=php parameter entity argument (pe) should be bool update test --- diff --git a/ext/xmlwriter/php_xmlwriter.c b/ext/xmlwriter/php_xmlwriter.c index d9f152e586..1ac64c4f39 100644 --- a/ext/xmlwriter/php_xmlwriter.c +++ b/ext/xmlwriter/php_xmlwriter.c @@ -1366,13 +1366,14 @@ static PHP_FUNCTION(xmlwriter_write_dtd_entity) int name_len, content_len, retval; /* Optional parameters */ char *pubid = NULL, *sysid = NULL, *ndataid = NULL; - int pe = 0, pubid_len, sysid_len, ndataid_len; + zend_bool pe = 0; + int pubid_len, sysid_len, ndataid_len; #ifdef ZEND_ENGINE_2 zval *this = getThis(); if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s&s&|ls&s&s&", + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s&s&|bs&s&s&", &name, &name_len, UG(utf8_conv), &content, &content_len, UG(utf8_conv), &pe, &pubid, &pubid_len, UG(utf8_conv), &sysid, &sysid_len, UG(utf8_conv), &ndataid, &ndataid_len, UG(utf8_conv)) == FAILURE) { @@ -1382,7 +1383,7 @@ static PHP_FUNCTION(xmlwriter_write_dtd_entity) } else #endif { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs&s&|ls&s&s&", &pind, + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs&s&|bs&s&s&", &pind, &name, &name_len, UG(utf8_conv), &content, &content_len, UG(utf8_conv), &pe, &pubid, &pubid_len, UG(utf8_conv), &sysid, &sysid_len, UG(utf8_conv), &ndataid, &ndataid_len, UG(utf8_conv)) == FAILURE) { diff --git a/ext/xmlwriter/tests/bug39504.phpt b/ext/xmlwriter/tests/bug39504.phpt index 3b70f6a2f2..669c77ee24 100644 --- a/ext/xmlwriter/tests/bug39504.phpt +++ b/ext/xmlwriter/tests/bug39504.phpt @@ -11,8 +11,22 @@ xmlwriter_end_dtd($xw); xmlwriter_start_element($xw, "root"); xmlwriter_end_document($xw); print xmlwriter_flush($xw, true); +print "\n"; + +$xw = new XMLWriter(); +$xw->openMemory(); +$xw->startDocument(NULL, "UTF-8"); +$xw->startDtd("root"); +$xw->writeDtdEntity("c", NULL, 0, "-//W3C//TEXT copyright//EN", "http://www.w3.org/xmlspec/copyright.xml"); +$xw->endDtd(); +$xw->startElement("root"); +$xw->endDocument(); +print $xw->flush(true); ?> --EXPECTF-- ]> + + +]>