From ea92bb5f107420dbedf1b093edd5374e2ac22d6c Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Wed, 16 Aug 2017 19:04:47 +0000 Subject: [PATCH] Customize: Harden color control's logic for obtaining default value to prevent JS error when non-string default supplied. Props andreagobetti, yonivh for testing. Fixes #37174. Built from https://develop.svn.wordpress.org/trunk@41256 git-svn-id: http://core.svn.wordpress.org/trunk@41096 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/customize/class-wp-customize-color-control.php | 3 +-- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/wp-includes/customize/class-wp-customize-color-control.php b/wp-includes/customize/class-wp-customize-color-control.php index 1e7ed17786..8d9827351a 100644 --- a/wp-includes/customize/class-wp-customize-color-control.php +++ b/wp-includes/customize/class-wp-customize-color-control.php @@ -91,8 +91,7 @@ class WP_Customize_Color_Control extends WP_Customize_Control { ?> <# var defaultValue = '#RRGGBB', defaultValueAttr = '', isHueSlider = data.mode === 'hue'; - - if ( data.defaultValue && ! isHueSlider ) { + if ( data.defaultValue && _.isString( data.defaultValue ) && ! isHueSlider ) { if ( '#' !== data.defaultValue.substring( 0, 1 ) ) { defaultValue = '#' + data.defaultValue; } else { diff --git a/wp-includes/version.php b/wp-includes/version.php index e0f4a38c27..daab568fb4 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.9-alpha-41255'; +$wp_version = '4.9-alpha-41256'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.