I re-edited a bunch of posts to fix the stripped out angle bracket. Interesting writing.
Tag: libxml2
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' ||
LIBXML_DOTTED_VERSION == '2.7.1' ||
LIBXML_DOTTED_VERSION == '2.7.2') {
$xml =str_replace("<","<",$xml );
$xml =str_replace(">",">",$xml );
$xml =str_replace("&","&",$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:
- 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
- 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
-
Now fix the symlinks in /usr/lib so everyone uses the new (but old) library:
cd /usr/lib rm libxml2.so libxml2.so.2 ln -s libxml2.so.2.6.32 libxml2.so ln -s libxml2.so.2.6.32 libxml2.so.2
-
Actually, I didn’t do the above but instead replaced the actual 2.7.2 library:
mv libxml2.so.2.7.2 libxml2.so.2.7.2.orig ln -s libxml2.so.2.6.32 libxml2.so.2.7.2
-
Restart apache so that PHP uses the new libraries:
/etc/init.d/apache2 restart