|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-05-09 23:40 UTC] iliaa@php.net
[2007-05-11 01:00 UTC] rasch at raschnet dot com
[2007-05-15 02:04 UTC] rasch at raschnet dot com
[2007-05-16 11:46 UTC] rrichards@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 06:00:01 2025 UTC |
Description: ------------ In usage of symfony, our code was mistakenly producing a meta tag with two content types. However, from what I understand it's not invalid, but either way PHP falls on this, the DOM parser should return an error. The current behavior is that PHP returns an empty string when calling '$dom->saveHTML()' in the code sample below. Reproduce code: --------------- $dom = new DomDocument("1.0", "utf-8"); $val =$dom->loadHTML(' <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8, text/html; charset=utf-8"> </head> <body>Hello</body></html>'); var_dump($val); print $dom->saveHTML(); print "\n^^^ empty string\n"; Expected result: ---------------- <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8, text/html; charset=utf-8"> </head> <body><p>Hello</p></body></html> Actual result: -------------- bool(true) // ^^^ empty string