|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45600 dump_file character conversion
Submitted: 2008-07-23 10:09 UTC Modified: 2008-07-23 18:39 UTC
From: patrick dot lanove at telenet dot be Assigned:
Status: Wont fix Package: DOM XML related
PHP Version: 4.4.8 OS: Windows XP
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2008-07-23 10:09 UTC] patrick dot lanove at telenet dot be
Might have found a bug in this function.
When the document pased contains special characters like ?,?,?...
some level of character conversion is done in the output.

Also, special characters pased as filename are omitted in the outputed filename.

The string '?t ' in the reproduction code is converted to unicode
character/CJK Unified Ideographs 9D20 (decimal: 40194).

loaded modules:

Apache version 2.2.3

in some other bugreports, it was said dump_file calls on functions from libxml12, there is no such file in php's dir.

Reproduce code:
$doc = domxml_new_doc('1.0');
$root = $doc->create_element('HTML');
$root = $doc->append_child($root);
$head = $doc->create_element('HEAD');
$head = $root->append_child($head);
$title = $doc->create_element('TITLE');
$title = $head->append_child($title);
$text = $doc->create_text_node('This is y?t another title');
$text = $title->append_child($text);
$path = 'some_absolute_path';
$filename = 'bugt?st3.xml';
$doc->dump_file($path . '/' . $filename, false, true);

Expected result:
filename: bugt?st3.xml
<?xml version="1.0"?>
    <TITLE>This is a title</TITLE>

Actual result:
filename: bugtst3.xml
<?xml version="1.0"?>
    <TITLE>This is y&#x9D20;another title</TITLE>


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-07-23 18:39 UTC]
domxml and PHP4 isn't supported anymore, you have to live with the bug. 
I can't even say, if it's a bug, I didn't look closely at it, but there 
won't be any new (non security) releases of domxml and/or PHP 4.4
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Dec 01 17:01:28 2023 UTC