[php-maint] Bug#520246: php5-common: libxml2 2.7.3.dfsg-1 causes tags and entity references in entities to be not parsed

Виталий Виталий
Wed Mar 18 11:34:05 UTC 2009


Package: php5-common
Version: 5.2.6.dfsg.1-3
Severity: important    

Description:
When using PHP's internal xml parser (xml_parser_create) linked to libxml2,
standard entity references ("<", ">", "'", """, "&") are
all cut off and not passed to character_data_handler.                       

All is good with libxml2 2.6.32.dfsg-5. Instead, this is caused by "voodoo code"
in PHP. See links below:                                                        
php.net bug: http://bugs.php.net/bug.php?id=45996                               
("libxml2 2.7.1 causes breakage with character data in xml_parse()")            
Mandriva bug: https://qa.mandriva.com/show_bug.cgi?id=43486                     

Reproduce code (PHP):
<?php                
$xml = <<<HERE       
<test>---&lt;test&gt;---&amp;---&quot;---</test>
HERE;                                           

$parser = xml_parser_create('UTF-8');
xml_set_character_data_handler($parser, 'cdata');
xml_parse($parser, $xml);                        

function cdata($parser, $data)
{                             
    print "$data\n";          
}                             
?>

Expected results:
---
<
test
>
---
&
---
"
---

Actual results:
---
test
---
---
---

-- System Information:
Debian Release: squeeze/sid
  APT prefers oldstable
  APT policy: (500, 'oldstable'), (500, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-1-686 (SMP w/2 CPU cores)
Locale: LANG=ru_RU.KOI8-R, LC_CTYPE=ru_RU.KOI8-R (charmap=KOI8-R)
Shell: /bin/sh linked to /bin/bash

Versions of packages php5-common depends on:
ii  libc6                         2.9-4      GNU C Library: Shared libraries
ii  sed                           4.1.5-8    The GNU sed stream editor

php5-common recommends no packages.

php5-common suggests no packages.

-- no debconf information

-- 
With best regards,
  Vitaliy Filippov







More information about the pkg-php-maint mailing list