mirror of
https://github.com/php/php-src.git
synced 2025-08-16 22:18:50 +02:00
MFH: parameter entity argument (pe) should be bool
update test
This commit is contained in:
parent
d1891c3d8a
commit
57792acabc
2 changed files with 18 additions and 3 deletions
|
@ -1347,13 +1347,14 @@ static PHP_FUNCTION(xmlwriter_write_dtd_entity)
|
||||||
int name_len, content_len, retval;
|
int name_len, content_len, retval;
|
||||||
/* Optional parameters */
|
/* Optional parameters */
|
||||||
char *pubid = NULL, *sysid = NULL, *ndataid = NULL;
|
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
|
#ifdef ZEND_ENGINE_2
|
||||||
zval *this = getThis();
|
zval *this = getThis();
|
||||||
|
|
||||||
if (this) {
|
if (this) {
|
||||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|lsss",
|
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|bsss",
|
||||||
&name, &name_len, &content, &content_len, &pe, &pubid, &pubid_len,
|
&name, &name_len, &content, &content_len, &pe, &pubid, &pubid_len,
|
||||||
&sysid, &sysid_len, &ndataid, &ndataid_len) == FAILURE) {
|
&sysid, &sysid_len, &ndataid, &ndataid_len) == FAILURE) {
|
||||||
return;
|
return;
|
||||||
|
@ -1362,7 +1363,7 @@ static PHP_FUNCTION(xmlwriter_write_dtd_entity)
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss|lsss", &pind,
|
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss|bsss", &pind,
|
||||||
&name, &name_len, &content, &content_len, &pe, &pubid, &pubid_len,
|
&name, &name_len, &content, &content_len, &pe, &pubid, &pubid_len,
|
||||||
&sysid, &sysid_len, &ndataid, &ndataid_len) == FAILURE) {
|
&sysid, &sysid_len, &ndataid, &ndataid_len) == FAILURE) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -11,8 +11,22 @@ xmlwriter_end_dtd($xw);
|
||||||
xmlwriter_start_element($xw, "root");
|
xmlwriter_start_element($xw, "root");
|
||||||
xmlwriter_end_document($xw);
|
xmlwriter_end_document($xw);
|
||||||
print xmlwriter_flush($xw, true);
|
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--
|
--EXPECTF--
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE root [<!ENTITY ent2 "val2">]><root/>
|
<!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/>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue