#32114 [Opn->Csd]: DOM crashing when attribute appended to Document

From: Date: Fri, 25 Feb 2005 22:24:09 +0000
Subject: #32114 [Opn->Csd]: DOM crashing when attribute appended to Document
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-77103@lists.php.net to get a copy of this message
ID: 32114 Updated by: rrichards@php.net -Summary: DOMDocument->dump_mem() crashes when encoding attribute already set Reported By: miroslav dot sulc at startnet dot cz -Status: Open +Status: Closed Bug Type: DOM XML related Operating System: linux PHP Version: 4.3.10 New Comment: This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Attributes can only appended to Element nodes. Now issues warning when attempting this operation. Changed summary as well. Previous Comments: ------------------------------------------------------------------------ [2005-02-25 21:43:48] miroslav dot sulc at startnet dot cz Corrected summary ------------------------------------------------------------------------ [2005-02-25 21:41:06] miroslav dot sulc at startnet dot cz Description: ------------ When dumping DOM XML document using $string = $doc->dump_mem(true, 'UTF-8') on document where encoding is already set using, the PHP crashes. Reproduce code: --------------- $doc = domxml_new_doc('1.0'); $attribute = $doc->create_attribute('encoding', 'UTF-8'); $doc->append_child($attribute); // This line makes the PHP crash $string = $doc->dump_mem(true, 'UTF-8'); Expected result: ---------------- It shouldn't crash. It just may issue a warning. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=32114&edit=1

« previous php.bugs (#77103) next »