[wp-trac] [WordPress Trac] #40749: Inline style shortcode for background-image issue #2

WordPress Trac noreply at wordpress.org
Fri May 12 19:01:30 UTC 2017


#40749: Inline style shortcode for background-image issue #2
-----------------------------+-----------------------------
 Reporter:  markusfroehlich  |      Owner:
     Type:  enhancement      |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  General          |    Version:  4.7.4
 Severity:  normal           |   Keywords:
  Focuses:                   |
-----------------------------+-----------------------------
 Shortcodes in a style attribute for example:
 {{{
 <div style="background-image: url([my-shortcode id='1']);"></div>
 }}}
 are not working, because in the function "safecss_filter_attr()"
 (w-includes/kses.php) (Line: 1688), the regex filters the "(" and return
 an empty string.
 I know that this a security restriction is.
 But it is it possible to filter the regex pattern with a WordPress filter?

 My problem is, that i am writing on an Template WordPress Plugin for
 Custom Post Types. The Plugin can use the Muffin Builder (Betheme) or
 Visual Composer.
 Now when the users (or employees) want to place a shortcode in the
 Background Image Field, the shortcode will be ignored because of the
 safecss_filter_attr() function.
 Please give me a help and let me filter the regex pattern.

 Thank you very much
 Markus

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


More information about the wp-trac mailing list