note 100335 added to function.xml-set-character-data-handler
| From: | svanegmond at tinyplanet dot ca | Date: | Fri, 08 Oct 2010 19:06:06 +0000 |
| Subject: | note 100335 added to function.xml-set-character-data-handler | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-173088@lists.php.net to get a copy of this message | ||
For those who are having their character entities eaten by this function (e.g. & <
and so forth) and are unwilling to wait for the PATHETICALLY OLD BUG http://bugs.php.net/bug.php?id=45996 to get
addressed:
You will notice that your callback gets called several times.
input: Give me some beans & rice.  
call 1: Give me some beans
call 2: amp; and rice
call 3: #032;
There is an obvious workaround. This is not perfect:
$text = preg_replace('/^([a-z]+;)/','&\1', $text);
$text = preg_replace('/^(#[0-9]+;)/', '&\1', $text);
----
Server IP: 216.235.13.26
Probable Submitter: 69.196.152.244
----
Manual Page -- http://www.php.net/manual/en/function.xml-set-character-data-handler.php
Edit -- https://master.php.net/note/edit/100335
Del: integrated -- https://master.php.net/note/delete/100335/integrated
Del: useless -- https://master.php.net/note/delete/100335/useless
Del: bad code -- https://master.php.net/note/delete/100335/bad+code
Del: spam -- https://master.php.net/note/delete/100335/spam
Del: non-english -- https://master.php.net/note/delete/100335/non-english
Del: in docs -- https://master.php.net/note/delete/100335/in+docs
Del: other reasons-- https://master.php.net/note/delete/100335
Reject -- https://master.php.net/note/reject/100335
Search -- https://master.php.net/manage/user-notes.php