When the filter inserts images the class="smiley-class" attribute is omitted. This is a problem for us as all other images inside content have been themed to have border, padding, etc. It also means one is unable to style the images without affecting others inside content.

Very simple to fix inside the smileys_filter_process function.

140c140
<         $text = eregi_replace("([ ,\.\?!:\(\)\r\n\<\>])". preg_quote($a) ."([ ,\.\?!:\(\)\r\n\<\>])", "\\1<img src=\"". check_url(base_path() . $smiley->image) ."\" title=\"". check_plain($alt) ."\" alt=\"". check_plain($alt) ."\" />\\2", $text);
---
>         $text = eregi_replace("([ ,\.\?!:\(\)\r\n\<\>])". preg_quote($a) ."([ ,\.\?!:\(\)\r\n\<\>])", "\\1<img src=\"". check_url(base_path() . $smiley->image) ."\" title=\"". check_plain($alt) ."\" alt=\"". check_plain($alt) ."\" class=\"smiley-class\" />\\2", $text);
142c142
<         $text = eregi_replace(preg_quote($a), '<img src="'. check_url(base_path() . $smiley->image) .'" title="'. check_plain($alt) .'" alt="'. check_plain($alt) .'" />', $text);
---
>         $text = eregi_replace(preg_quote($a), '<img src="'. check_url(base_path() . $smiley->image) .'" title="'. check_plain($alt) .'" alt="'. check_plain($alt) .'" class=\"smiley-class\" />', $text);

Comments

Gurpartap Singh’s picture

Assigned: Unassigned » Gurpartap Singh
Category: bug » feature
Status: Needs review » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.