]> granicus.if.org Git - php/commitdiff
parameter entity argument (pe) should be bool
authorRob Richards <rrichards@php.net>
Sat, 6 Jan 2007 18:03:15 +0000 (18:03 +0000)
committerRob Richards <rrichards@php.net>
Sat, 6 Jan 2007 18:03:15 +0000 (18:03 +0000)
update test

ext/xmlwriter/php_xmlwriter.c
ext/xmlwriter/tests/bug39504.phpt

index d9f152e586485acd6a0b038c011c8f5b5086a314..1ac64c4f39b2f1496d14928abaa9e7584960ddba 100644 (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) {
index 3b70f6a2f21eab77f422a34fb9c77a9a9371a67a..669c77ee24ae4cedf496d546d8e98e56ba184a60 100644 (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/>