[wp-trac] [WordPress Trac] #20017: Reduce memory usage in kses.php

WordPress Trac wp-trac at lists.automattic.com
Fri Feb 10 21:07:48 UTC 2012


#20017: Reduce memory usage in kses.php
--------------------------+-------------------------------------
 Reporter:  duck_         |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Performance   |    Version:
 Severity:  normal        |   Keywords:  has-patch needs-testing
--------------------------+-------------------------------------
 Our allowed attributes rules in kses.php create a large number of empty
 arrays. These can all be replaced with `true` instead. This reduces memory
 usage by 62 kilobytes - not huge, but it all adds up.

 This change is possible because the arrays are only used for attribute
 value checks, see wp_kses_attr(). Anything other than array just indicates
 that the attribute is allowed, see kses README and docs/attribute-value-
 checks for examples.

 The block that filters style attributes with safecss_filter_attr() has to
 be moved out of the is_array() check to accommodate for this.

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


More information about the wp-trac mailing list