Help - Search - Members - Calendar
Full Version: Images not allowed in comments?
Movable Type Community Forum > Additional Resources > Tips and Tricks
shogun
I have been trying to enable clickable smilies on my comment pages with the help of the good people here at this forum.

See the original thread.

Everything seems to work fine. When you click on a smile the following code is inserted:

CODE
<img src='http://www.skodun.is/smilies/happy.gif' width='15' height='15'>


However this code disappears when you press the preview button OR if you try to publish the comment. Therefore no smiley appears on the actual page.

Since other code such as
CODE
<b></b>
works fine I'm wondering if comments simply don't allow "img src" code? Anyone knows the answer to this?

Thanks!
Dead God
The latest version of MT now includes the Sanitize plugin by default. If you have "Allow HTML in comments" turned on then the Sanitize plugin comes into play and strips out any non-sanctioned HTML one tries to use in comments. By default the IMG tag is filtered out. The default tags allowed in comments are "a href, b, br, p, strong, em, ul, li, blockquote." You'll note that the underline tag is also filtered out for reasons I'm unclear on.

You can change what is and isn't filtered out in the weblog config section of MT for each weblog individually or for all weblogs by editing your mt.cfg file. See the Sanitize section of the MT manual for more information on how this works and how to modify it.
shogun
Thanks alot.

Under:
"Main Menu > Site Editing Menu > Configuration > Preferences"

In the "Sanitize Spec" I selected "Use my settings:" and wrote "a href, b, br, p, strong, em, ul, li, blockquote, img src"

Now my smilies work as they should biggrin.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.