parameter entity argument (pe) should be bool

update test
This commit is contained in:
Rob Richards 2007-01-06 18:03:15 +00:00
parent 71a68db63e
commit 05a532c07a
2 changed files with 18 additions and 3 deletions

View File

@ -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) {

View File

@ -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--
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE root [<!ENTITY ent2 "val2">]><root/>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE root [<!ENTITY c PUBLIC "-//W3C//TEXT copyright//EN" "http://www.w3.org/xmlspec/copyright.xml">]><root/>