Htmlspecialchars and encoding

6 views
Skip to first unread message

Michael Clerx

unread,
May 27, 2011, 10:43:03 AM5/27/11
to simplewiki
For all sorts of encoding issues & preferences it'd be nice to be able
to change the way html text is emitted. I've currently hacked this
into the emitter by replacing all calls to htmlspecialchars($text)
with a call to $this->htmlChars($text). This method then calls
htmlspecialchars with slightly modified parameters (in fact, it even
calls htmlentities instead!)

A more versatile implementation could use a callback instead, and some
method like setHtmlspecialcharsCallback($callback)

Could a similar trick be implemented in the official version?

Henrik Bechmann

unread,
May 27, 2011, 2:13:38 PM5/27/11
to simpl...@googlegroups.com
Oh goody, more indirection!<grin>.

I don't see why not, and I'll put it on the list. Simplewiki can provide the default handler which can use htmlpecialchars.

I may do htmlChars($text, $node = NULL) to provide the callback the option to make decisions based on the type (or context) of node that is requesting the filter.

I may call it something else too, like charFilter perhaps.

- H


--
You received this message because you are subscribed to the Google Groups "simplewiki" group.
To post to this group, send email to simpl...@googlegroups.com.
To unsubscribe from this group, send email to simplewiki+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/simplewiki?hl=en.




--
bechmann.ca
Reply all
Reply to author
Forward
0 new messages