[wp-trac] [WordPress Trac] #55966: safecss_filter_attr() returns empty if containing min()

WordPress Trac noreply at wordpress.org
Sat Jun 11 13:22:39 UTC 2022

#55966: safecss_filter_attr() returns empty if containing min()
 Reporter:  uxl           |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  6.0
 Severity:  major         |   Keywords:
  Focuses:  css           |
 I have block themes that define layout ({{{contentSize}}} and
 {{{wideSize}}} in {{{theme.json}}}) using {{{min()}}}

 The issue is that {{{wp_get_layout_style()}}} returns nothing as
 {{{safecss_filter_attr()}}} does not recognize {{{min()}}} as valid CSS.

 This was not previously an issue because it used to be filtered using
 {{{wp_strip_all_tags()}}} as {{{gutenberg_get_layout_style()}}} still does
 when Gutenberg is active.

 However there is a TODO note in Gutenberg that it will switch to using
 {{{safecss_filter_attr}}} in future.

 I would ask that {{{min()}}} and any other missing valid CSS be allowed
 similar to how this was fixed to allow {{{calc()}}} and {{{var()}}}


Ticket URL: <https://core.trac.wordpress.org/ticket/55966>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list