WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#39728 closed defect (bug) (duplicate)

"Additional CSS" validate syntax error in customizer

Reported by: rishishah Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.8
Component: Customize Keywords:
Focuses: ui Cc:

Description

Validation for Additional CSS in customize is not correct.

STEP TO REPRODUCE

  1. Go to "Appearance>Customize"
  2. Select "Additional CSS"
  3. When I wrote curly brace "{" or "}" inside comment section /* ... */ and save it, it shows me error that
Your curly brackets {} are imbalanced. Make sure there is a closing } for every opening {.

This error should not consider inside comment section /* ... */

Attachments (1)

additional-css-issue.gif (1.7 MB) - added by rishishah 3 years ago.

Download all attachments as: .zip

Change History (4)

#1 @SergeyBiryukov
3 years ago

  • Focuses accessibility removed
  • Summary changed from "Additional CSS" validate syntex error in customizer to "Additional CSS" validate syntax error in customizer

#2 @dd32
3 years ago

See also #39198 for where we removed the check for single quotes ' but left it in place for {, }, and ".

We've also got #39218 to use a tokeniser rather than naive regular expressions.

I don't think we should change it further for the 4.7.x branch myself (unless we backport tokenisation). I'd suggest marking this as a duplicate of #39218.

#3 @westonruter
3 years ago

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

Duplicate of #39218.

Agreed. Also, I think that the current server-side validation can be eliminated in favor of client-side validation that will come with a proper code editor component in #38707.

Note: See TracTickets for help on using tickets.