← All changes
|
lib/class-wp-rest-global-styles-controller-gutenberg.php
+1
-9
23.6.2
→
22.7.0
View file →
| @@ -697,20 +697,12 @@ | ||
| 697 | 697 | * @since 7.0.0 Only restricts contents which risk prematurely closing the STYLE element, |
| 698 | 698 | * either through a STYLE end tag or a prefix of one which might become a |
| 699 | 699 | * full end tag when combined with the contents of other styles. |
| 700 | 700 | * |
| 701 | - * @param mixed $css CSS to validate. | |
| 701 | + * @param string $css CSS to validate. | |
| 702 | 702 | * @return true|WP_Error True if the input was validated, otherwise WP_Error. |
| 703 | 703 | */ |
| 704 | 704 | protected function validate_custom_css( $css ) { |
| 705 | - if ( ! is_string( $css ) ) { | |
| 706 | - return new WP_Error( | |
| 707 | - 'rest_custom_css_invalid_type', | |
| 708 | - __( 'CSS must be a string.', 'gutenberg' ), | |
| 709 | - array( 'status' => 400 ) | |
| 710 | - ); | |
| 711 | - } | |
| 712 | - | |
| 713 | 705 | $length = strlen( $css ); |
| 714 | 706 | for ( |
| 715 | 707 | $at = strcspn( $css, '<' ); |
| 716 | 708 | $at < $length; |