Re: Problems with XML_Transformer

From: Date: Fri, 07 Mar 2003 23:08:34 +0000
Subject: Re: Problems with XML_Transformer
References: 1 2 3 4 5  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-14150@lists.php.net to get a copy of this message
On Fri, 2003-03-07 at 22:41, Kristian Koehntopp wrote: > Does not cover htmlspecialchars in content, only in attribute values. > Any valid solution has to cover both cases. I changed it a bit, and now it looks much simpler. I do htmlspecialchars() every time before calling transform() and revert the result after the call. Now you don't need to type '&' instead of '&' inside your transformer methods. I believe it works in both attribute values and cdata. Give it a try. Check the attached patch to (the original) Transformer.php. Regards -- Bruno Pedro PTM.com Get my public key here: http://search.keyserver.net:11371/pks/lookup?op=get&search=0x9FEECDC8

586c586,587 < $cdata = $transformer->transform($cdata); --- > $cdata = $transformer->transform(htmlspecialchars($cdata)); > $cdata = strtr($cdata, array_flip(get_html_translation_table(HTML_SPECIALCHARS))); Attachment: [application/pgp-signature] This is a digitally signed message part signature.asc
« previous php.pear.dev (#14150) next »