WordPress.org

Make WordPress Core

Ticket #39198: 39198.0.diff

File 39198.0.diff, 2.0 KB (added by westonruter, 3 years ago)
  • src/wp-includes/customize/class-wp-customize-custom-css-setting.php

    diff --git src/wp-includes/customize/class-wp-customize-custom-css-setting.php src/wp-includes/customize/class-wp-customize-custom-css-setting.php
    index cb0f151..ff66efe 100644
    final class WP_Customize_Custom_CSS_Setting extends WP_Customize_Setting { 
    192192                }
    193193
    194194                // Ensure single quotes are equal.
    195                 if ( ! $this->validate_equal_characters( '\'', $css ) ) {
    196                         $validity->add( 'unequal_single_quotes', __( 'Your single quotes <code>\'</code> are uneven. Make sure there is a closing <code>\'</code> for every opening <code>\'</code>.' ) );
    197                         $imbalanced = true;
    198                 }
    199 
    200                 // Ensure single quotes are equal.
    201195                if ( ! $this->validate_equal_characters( '"', $css ) ) {
    202196                        $validity->add( 'unequal_double_quotes', __( 'Your double quotes <code>"</code> are uneven. Make sure there is a closing <code>"</code> for every opening <code>"</code>.' ) );
    203197                        $imbalanced = true;
  • tests/phpunit/tests/customize/custom-css-setting.php

    diff --git tests/phpunit/tests/customize/custom-css-setting.php tests/phpunit/tests/customize/custom-css-setting.php
    index 102d303..7aff1b4 100644
    class Test_WP_Customize_Custom_CSS_Setting extends WP_UnitTestCase { 
    364364                $result = $this->setting->validate( $imbalanced_double_quotes );
    365365                $this->assertTrue( array_key_exists( 'unequal_double_quotes', $result->errors ) );
    366366
    367                 // Check for Imbalanced Single Quotes.
    368                 $imbalanced_single_quotes = $basic_css . " div.background-image { background-image: url( 'image.jpg ); } ";
    369                 $result = $this->setting->validate( $imbalanced_single_quotes );
    370                 $this->assertTrue( array_key_exists( 'unequal_single_quotes', $result->errors ) );
    371 
    372367                // Check for Unclosed Parentheses.
    373368                $unclosed_parentheses = $basic_css . ' div.background-image { background-image: url( "image.jpg" ; } ';
    374369                $result = $this->setting->validate( $unclosed_parentheses );