[wp-trac] [WordPress Trac] #4755: WordPress should use code from the modified kses at Sourceforge.net

WordPress Trac wp-trac at lists.automattic.com
Wed Aug 15 21:56:42 GMT 2007

#4755: WordPress should use code from the modified kses at Sourceforge.net
 Reporter:  alpha2zee     |       Owner:  anonymous   
     Type:  enhancement   |      Status:  new         
 Priority:  normal        |   Milestone:  2.4 (future)
Component:  Optimization  |     Version:              
 Severity:  normal        |    Keywords:              
 A modified and better version of the ''kses'' HTML filter has been
 developed by [http://bioinformatics.org/phplabware">PHP Labware] for their
 next LabWiki release. It is currently
 available at Sourceforge].

 Wordpress should think of using its code -- the ''kses.php'' it uses still
 has some bugs that can be thus fixed. Also, there are new features in the
 modified version, and its use is compatible with the current kses() calls.

 '''Bug-fixes''' (compared to oirignal kses 0.2.2):

 * Lone < characters are taken care of

 * Takes care of single-tag elements like img and br that do not have a
 space before their closing tag (e.g., ''<hr/>'')

 * Output is more XHTML standard-compliant. E.g., attributes are declared
 only once, tags and attributes are lowercased, check for named XHTML
 entities, etc.

 '''Extra features'''

 * Inline styling is now possible. Earlier, CSS properties like
 ''background-color: yellow'' were removed because of the so-called 'colon

 * Option to balance tags for well-formedness of (X)HTML

 * Option to 'entitify' unallowed tags instead of removing them. Currently,
 kses always strips them.

 * Option for unique ID attribute values, with option to remove or with a
 chosen prefix

 * Option to allow HTML comments and CDATA sections.

 The download has some test-results.

 (The upcoming release makes it easier to specify allowed tags (string
 instead of multi-dimensional array), specify element and attribute
 specific protocols and class properties, etc.)

Ticket URL: <http://trac.wordpress.org/ticket/4755>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software

More information about the wp-trac mailing list