[wp-trac] [WordPress Trac] #43824: get_theme_mod: sprintf on $default parameter would (wrongly) strip any '%'

WordPress Trac noreply at wordpress.org
Sat Apr 21 06:09:37 UTC 2018


#43824: get_theme_mod: sprintf on $default parameter would (wrongly) strip any '%'
--------------------------+-----------------------------
 Reporter:  daviedR       |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Customize     |    Version:  4.9.5
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Hi,

 I noticed that the `get_theme_mod` function use sprintf on the `$default`
 parameter, as seen on this line:
 https://core.trac.wordpress.org/browser/tags/4.9.5/src/wp-
 includes/theme.php#L872

 Any `%` character in the `$default` string would be stripped.

 For example:
 `get_theme_mod( 'my_theme_mod_key', '100%' );` would return `'100'` as the
 default value, not `'100%'`.

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


More information about the wp-trac mailing list