From:             tbrandl at barff dot de
Operating system: WinXP/Linux
PHP version:      4.3.8
PHP Bug Type:     DOM XML related
Bug description:  CDATA section is not recognized as such

Description:
------------
The first child of <data>, a CDATA-section, is not recognized as such, but
identified as a text object.

According to the documentation, the type should be 4 instead of 3.

works (tested, that is) on 4.3.1, 4.3.6
fails on 4.3.8, 4.3.9

Reproduce code:
---------------
$xmlString = '<?xml version="1.0"?><root><data><![CDATA[Some CData
content]]></data></root>';
$xml = domxml_open_mem($xmlString);

$node = $xml->get_elements_by_tagname('data');
$cdata_section = $node[0]->child_nodes();

echo phpversion();

print_r($cdata_section[0]);


Expected result:
----------------
4.3.6

domcdata Object
(
    [type] => 4
    [content] => Some CData content
    [0] => 3
    [1] => 12561912
)


Actual result:
--------------
4.3.8 / 4.3.9

domtext Object
(
    [type] => 3
    [name] => #text
    [content] => Some CData content
    [0] => 3
    [1] => 140237488
)

-- 
Edit bug report at http://bugs.php.net/?id=30480&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=30480&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30480&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30480&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=30480&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=30480&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=30480&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=30480&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=30480&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=30480&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=30480&r=notwrong
Not enough info:             http://bugs.php.net/fix.php?id=30480&r=notenoughinfo
Submitted twice:             http://bugs.php.net/fix.php?id=30480&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=30480&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=30480&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=30480&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=30480&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=30480&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=30480&r=float
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=30480&r=mysqlcfg

Reply via email to