php.net |  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: patrick dot lanove at telenet dot be
New email:
PHP Version: OS:

 

 [2008-07-23 10:09 UTC] patrick dot lanove at telenet dot be
Description:
------------
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:
php_domxml
php_iconv

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"?>
<HTML>
  <HEAD>
    <TITLE>This is a title</TITLE>
  </HEAD>
</HTML>

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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-07-23 18:39 UTC] chregu@php.net
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-2022 The PHP Group
All rights reserved.
Last updated: Thu Dec 08 06:05:52 2022 UTC