-
Notifications
You must be signed in to change notification settings - Fork 8k
Expand file tree
/
Copy pathbug39504.phpt
More file actions
34 lines (30 loc) · 970 Bytes
/
bug39504.phpt
File metadata and controls
34 lines (30 loc) · 970 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
--TEST--
Bug #39504 (xmlwriter_write_dtd_entity() creates Attlist tag, not entity)
--EXTENSIONS--
xmlwriter
--FILE--
<?php
$xw = xmlwriter_open_memory();
xmlwriter_start_document($xw, NULL, "UTF-8");
xmlwriter_start_dtd($xw, "root");
xmlwriter_write_dtd_entity($xw, "ent2", "val2");
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", "", 0, "-//W3C//TEXT copyright//EN", "http://www.w3.org/xmlspec/copyright.xml");
$xw->endDtd();
$xw->startElement("root");
$xw->endDocument();
print $xw->flush(true);
?>
--EXPECT--
<?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/>