Bug #71452 [Com]: Error parsing js strings which include tags.
| From: | qdinar at gmail dot com | Date: | Wed, 05 Jul 2017 06:35:43 +0000 |
| Subject: | Bug #71452 [Com]: Error parsing js strings which include tags. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-209816@lists.php.net to get a copy of this message | ||
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 confirm this for php 5.6.30 in windows 10.
Previous Comments:
------------------------------------------------------------------------
[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