-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Global Styles REST API endpoint: check custom CSS is included before attempting to validate #46561
Global Styles REST API endpoint: check custom CSS is included before attempting to validate #46561
Conversation
…attempting to validate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching this!
Tests well for me:
✅ In a blocks theme made an update to global styles without adding any custom CSS - saved without PHP warnings
✅ Added custom CSS - saved without PHP warnings
@ryanwelcher can we please get this one cherry-picked into the 14.8 release? |
…attempting to validate (#46561) * Global Styles REST API endpoint: check custom CSS is included before attempting to validate * Fix linting issue
…attempting to validate (#46561) * Global Styles REST API endpoint: check custom CSS is included before attempting to validate * Fix linting issue
I just cherry-picked this PR to the release/14.8 branch to get it included in the next release: 6ce4f45 |
What?
Follow up to #46141 to make sure that
$request['styles']['css']
is set before attempting to validate it.Why?
Without an additional check, saving global styles without custom CSS values resulted in a PHP warning being thrown:
How?
Add an
isset()
check before attempting to validate the custom CSS in global styles.Testing Instructions