Bug #71452 [Com]: Error parsing js strings which include tags.
Edit report at https://bugs.php.net/bug.php?id=71452&edit=1
ID: 71452
Comment by: qdinar at gmail dot com
Reported by: php at carl-ambroselli dot de
Summary: Error parsing js strings which include tags.
Status: Open
Type: Bug
Package: DOM XML related
Operating System: Tested MacOS & Debian
PHP Version: 5.5.31
Block user comment: N
Private report: N
New Comment:
i have reported another bug https://bugs.php.net/bug.php?id=74858 because i
have found that it differs from this by additional CDATA tag.
Previous Comments:
------------------------------------------------------------------------
[2017-07-05 06:35:43] qdinar at gmail dot com
i confirm this for php 5.6.30 in windows 10.
------------------------------------------------------------------------
[2016-01-26 10:38:06] php at carl-ambroselli dot de
Description:
------------
DomDocument fails to parse a document if it includes JavaScript Strings with HTML Tags inside the
strings.
Test script:
---------------
$doc = new DomDocument();
$doc->loadHTML('<html><body><script>var p =
\'<p>123</p>\'</script></body></html>');
echo $doc->saveHTML();
Expected result:
----------------
<html><body><script>var p =
\'<p>123</p>\'</script></body></html>
Actual result:
--------------
<html><body><script>var p =
'<p>123'</script></body></html>
(The closing </p> tag got removed inside a JavaScript string)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=71452&edit=1
Thread (4 messages)