summaryrefslogtreecommitdiff
path: root/ext/xmlwriter
diff options
context:
space:
mode:
authorRob Richards <rrichards@php.net>2007-01-06 18:03:43 +0000
committerRob Richards <rrichards@php.net>2007-01-06 18:03:43 +0000
commit57792acabc29f73e4ac3580f7ec2bc748afbb278 (patch)
tree39d04272ab23b6c2dd585f9cf2e99b452bd390c4 /ext/xmlwriter
parentd1891c3d8ad579a9d171cac4a8e5d03fe7f4d927 (diff)
downloadphp-git-57792acabc29f73e4ac3580f7ec2bc748afbb278.tar.gz
MFH: parameter entity argument (pe) should be bool
update test
Diffstat (limited to 'ext/xmlwriter')
-rw-r--r--ext/xmlwriter/php_xmlwriter.c7
-rw-r--r--ext/xmlwriter/tests/bug39504.phpt14
2 files changed, 18 insertions, 3 deletions
diff --git a/ext/xmlwriter/php_xmlwriter.c b/ext/xmlwriter/php_xmlwriter.c
index 84f1522c20..ac823b217b 100644
--- a/ext/xmlwriter/php_xmlwriter.c
+++ b/ext/xmlwriter/php_xmlwriter.c
@@ -1347,13 +1347,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, "ss|lsss",
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|bsss",
&name, &name_len, &content, &content_len, &pe, &pubid, &pubid_len,
&sysid, &sysid_len, &ndataid, &ndataid_len) == FAILURE) {
return;
@@ -1362,7 +1363,7 @@ static PHP_FUNCTION(xmlwriter_write_dtd_entity)
} else
#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,
&sysid, &sysid_len, &ndataid, &ndataid_len) == FAILURE) {
return;
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--
<?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/>