Bug #69097 [NEW]: DOMNode->textContent completely ignores <br> newlines.
From: divinity76 at gmail dot com
Operating system: insignificant
PHP version: 5.6.6
Package: DOM XML related
Bug Type: Bug
Bug description:DOMNode->textContent completely ignores <br> newlines.
Description:
------------
DOMNode->textContent created with DOMDocument->loadHTML completely
ignores <br> newlines.
i guess Bug #32581
could be related, but this is for PHP5/7, that's for PHP4
Test script:
---------------
<?php
$domd=new DOMDocument();
$domd->loadHTML("<pre>line1<br/>line2\nline3</pre>");
var_dump($domd->textContent);
Expected result:
----------------
string(17) "line1
line2
line3" //<<expected result when newlines are 1 byte long
Actual result:
--------------
string(16) "line1line2
line3"//<<actual result when newlines are 1 byte long
--
Edit bug report at https://bugs.php.net/bug.php?id=69097&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69097&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69097&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69097&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=69097&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=69097&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=69097&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=69097&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=69097&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=69097&r=support
Expected behavior: https://bugs.php.net/fix.php?id=69097&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=69097&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=69097&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=69097&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69097&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=69097&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=69097&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=69097&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=69097&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=69097&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=69097&r=mysqlcfg
Thread (4 messages)
- divinity76 at gmail dot com