I re-edited a bunch of posts to fix the stripped out angle bracket. Interesting writing.

Fixing libxml2, php, WordPress, and the missing angle brackets

Someone posted a temporary fix for WordPress that takes the raw xml and replaces the offending entities with characters. He found three places. The fix looks like:

//xmllib 2.7.0 -2.7.2 stripping leading angle brackets bug patch
if(LIBXML_DOTTED_VERSION == '2.7.0' ||
  $xml =str_replace("&lt;","<",$xml );
  $xml =str_replace("&gt;",">",$xml );
  $xml =str_replace("&amp;","&",$xml );
//end Fix
xml_parse($parser, $xml);

Fixing libxml2, php, WordPress, and the missing angle brackets

I was having problems with MarsEdit after updating to OpenSuse 11.1 because of a bug in php aggravated by a recent release of libxml2 (details here).
I was waiting for a real fix but lost my patience today. The advice was to “fall back to libxml2-2.6.32” so here’s what I did:

  1. Grabbed the RPM from the OpenSuse 11.0 cd. Or, if you trust me you can download it from here: libxml2-2.6.32-11.1.i586.rpm
  2. Install the RPM overriding any recent release which is what the “–force” flag does. Do the following as “root” from a terminal window:
    rpm -i --force libxml2-2.6.32-11.1.i586.rpm
  3. Now fix the symlinks in /usr/lib so everyone uses the new (but old) library:

    cd /usr/lib
    ln -s
    ln -s
  4. Actually, I didn’t do the above but instead replaced the actual 2.7.2 library:

    ln -s
  5. Restart apache so that PHP uses the new libraries:

    /etc/init.d/apache2 restart