[php-src] Issue #8388: DOMAttr unescapes HTML reference

From: Date: Sun, 17 Apr 2022 08:31:15 +0000
Subject: [php-src] Issue #8388: DOMAttr unescapes HTML reference
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-241036@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/8388 Author: t-tera ### Description The following code: ```php <?php $node = new DOMAttr('foo','bar'); $node->nodeValue = 'xx&#x31;yy'; var_dump($node->nodeValue); ``` Resulted in this output: ``` xx1yy ``` But I expected this output instead: ``` xx&#x31;yy ``` As shown above, setter of nodeValue unescapes HTML references. Because of this, I need to do the following: ```php $node->nodeValue = htmlspecialchars("xx&#x31;yy"); var_dump($node->nodeValue); ``` This outputs xx&#x31;yy. The setter should not unescape HTML references. ### PHP Version PHP 7.4.3 ### Operating System _No response_

« previous php.bugs (#241036) next »