Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#43824 closed defect (bug) (duplicate)

get_theme_mod: sprintf on $default parameter would (wrongly) strip any '%'

Reported by: daviedr's profile daviedR Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.9.5
Component: Customize Keywords:
Focuses: Cc:

Description

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%'.

Change History (1)

#1 @SergeyBiryukov
7 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Hi @daviedR, welcome to WordPress Trac!

Thanks for the report, we're already tracking this issue in #34290.

Note: See TracTickets for help on using tickets.