Results 1 to 7 of 7

Thread: PHP5 and LIBXML2 XML Parse Bug

  1. #1
    sundog_ak's Avatar
    sundog_ak is offline Junior Web Sage
    Join Date
    Sep 2008
    Location
    Alaska
    Posts
    11

    Default PHP5 and LIBXML2 XML Parse Bug

    It took me some time to figure this out, but there is a major bug with XML parsing when using PHP 5.2.6 and libxml2 (versions 2.7.0 to 2.7.2). Basically, when using the libxml library, it will strip out all the HTML entities so that all the "<" and "&" characters are stripped out. This renders the output as gibberish when using products like Live Writer and ScribeFire to upload content to sites like Word Press or Joomla. Other descriptions of issue (ARGH: I cannot post links do to the minimum 5 post limit):

    Seach for php bug #45996
    Typo3 bugtracker 00093359

    The main problem is there doesn't seem to be any rush by either PHP or the libxml developers to fix this bug. There seems to be a little bit of "debate" on who needs to fix it from what I have read. At any rate, the issue is still present and no immediate patches in site. There seems to be two fixes at the moment:

    1) Go back to the libxml versions less than 2.7.0 (which has potential issues), or

    2) Recompile PHP5 using libexpat

    Option two seems to be the best solution, but I am on Glowhost shared server (Advanced 5 Star) and do not have ability to recompile. Is option 2 something Glowhost would be able to do if I submitted a trouble ticket? I have waited many months for this bug to get resolved and I do not see anything in the PHP or libxml bug listings to indicate it will be.

    Cheers,
    Chris

  2. #2
    charlesh's Avatar
    charlesh is offline Master Glow Jedi
    Join Date
    Aug 2006
    Location
    Atlanta, GA - better than you imagined it would be.
    Posts
    189

    Default

    What about the built-in php xml parsing?

  3. #3
    sundog_ak's Avatar
    sundog_ak is offline Junior Web Sage
    Join Date
    Sep 2008
    Location
    Alaska
    Posts
    11

    Default

    Well, the issue is with the built-in php xml parsing when php is compiled using the libxml library rather than the expat library. Most hosts, including Glowhost (at least on the Deb server I am on) compile php with the libxml library which when using the php xml parsing functions results in the bug. If you go to that same link you provided and go to the "installation" heading, it describes (again I cannot provide link). You can test this problem with a simple set of code on your server:
    =================
    <?php
    $simple = "<root><node><strong>Teststring</strong></node></root>";
    $p = xml_parser_create();
    xml_parse_into_struct($p, $simple, $vals, $index);
    xml_parser_free($p);
    echo $vals[1]['value'];
    ?>
    =======================
    You should get output of a bolded text of "Teststring" as formatted like:

    <strong>Teststring</strong>

    instead, with php compiled to use libxml for xml php parsing, it will strip out the "<" resulting in:

    strongTeststring/strong

    Thus, produces gibberish and loss of formatting and is not something I can fix on a shared server since I cannot recompile php to use the expat libary rather than libxml for parsing. When I get to 5 posts I can post some more links on the issue.

    Thanks,
    Chris

  4. #4
    sundog_ak's Avatar
    sundog_ak is offline Junior Web Sage
    Join Date
    Sep 2008
    Location
    Alaska
    Posts
    11

    Default

    Well, I just saw at php.net that they fixed in CVS as long as the libxml2 2.7.3 or newer is used. I guess I will just have to wait for Glowhost to update to newest versions of php and libxml.

    http : // bugs.php.net/bug.php?id=45996

  5. #5
    charlesh's Avatar
    charlesh is offline Master Glow Jedi
    Join Date
    Aug 2006
    Location
    Atlanta, GA - better than you imagined it would be.
    Posts
    189

    Default

    Have you submitted a ticket on this to Glowhost?

  6. #6
    sundog_ak's Avatar
    sundog_ak is offline Junior Web Sage
    Join Date
    Sep 2008
    Location
    Alaska
    Posts
    11

    Default

    Thanks, I will do that once PHP 5.2.9 and LibXML2 2.7.3 are released stable (hopefully soon).

    Cheers,
    Chris

  7. #7
    sundog_ak's Avatar
    sundog_ak is offline Junior Web Sage
    Join Date
    Sep 2008
    Location
    Alaska
    Posts
    11

    Thumbs up

    I see the Deb server I am on has been updated with LibXML2 2.7.3 (half way there! and PHP 5.2.8. Hopefully, PHP will release 5.2.9 soon and this will be a resolved issue.

    I saw a couple posts that 5.2.9 would be released around February. It looks like Glowhost updates relatively quickly once things go stable (unlike my prior host where it took them forever to update).


Similar Threads

  1. Dolphin install parse error: syntax anybody?
    By abacab in forum General Support
    Replies: 5
    Last Post: 12-27-2009, 12:17 PM
  2. Anyone know a good XML database system?
    By Wumbate in forum Programming Talk
    Replies: 2
    Last Post: 10-24-2008, 01:39 PM
  3. Adding values from XML file to combo box
    By amie654 in forum Programming Talk
    Replies: 4
    Last Post: 08-12-2008, 05:49 PM
  4. Php5
    By AsdaLegend in forum General Support
    Replies: 11
    Last Post: 11-22-2007, 10:17 AM
  5. PHP5 - How to run PHP5 on your site
    By sergey in forum Knowledge Base
    Replies: 0
    Last Post: 09-04-2006, 08:50 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16