WordPress.org

Make WordPress Core

Changeset 41256


Ignore:
Timestamp:
08/16/2017 07:03:01 PM (9 months ago)
Author:
westonruter
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/customize/class-wp-customize-color-control.php

    r41162 r41256  
    9292        <# var defaultValue = '#RRGGBB', defaultValueAttr = '',
    9393            isHueSlider = data.mode === 'hue';
    94 
    95         if ( data.defaultValue && ! isHueSlider ) {
     94        if ( data.defaultValue && _.isString( data.defaultValue ) && ! isHueSlider ) {
    9695            if ( '#' !== data.defaultValue.substring( 0, 1 ) ) {
    9796                defaultValue = '#' + data.defaultValue;
Note: See TracChangeset for help on using the changeset viewer.