Validate style.css as valid CSS.
Description
Currently just checks for invalid markup.
Parameters
$css
stringrequired- CSS to validate.
Source
protected function validate_custom_css( $css ) {
if ( preg_match( '#</?\w+#', $css ) ) {
return new WP_Error(
'rest_custom_css_illegal_markup',
__( 'Markup is not allowed in CSS.' ),
array( 'status' => 400 )
);
}
return true;
}
User Contributed Notes
You must log in before being able to contribute a note or feedback.