[wp-trac] [WordPress Trac] #45484: starter content theme_mods/options throw php warning if not string

WordPress Trac noreply at wordpress.org
Tue Dec 4 16:49:53 UTC 2018


#45484: starter content theme_mods/options throw php warning if not string
--------------------------+-----------------------------
 Reporter:  timph         |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Customize     |    Version:  4.9.8
 Severity:  normal        |   Keywords:  needs-patch
  Focuses:                |
--------------------------+-----------------------------
 theme_mods/options can be mixed:
 https://developer.wordpress.org/reference/functions/set_theme_mod/
 https://developer.wordpress.org/reference/functions/update_option/

 When the starter content is checking for the post symbols in
 theme_mods/options it does a preg_match on the value, which throws PHP
 warnings:

 here: https://github.com/WordPress/WordPress/blob/4.9-branch/wp-includes
 /class-wp-customize-manager.php#L1531

 In the very least it would be nice if core could check if is_array.
 Better would be a more comprehensive check based on types, to attempt to
 extract the post symbols for the many types of theme_mods/options that
 people set.

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


More information about the wp-trac mailing list