Skip to content

Commit 2ea6a12

Browse files
sirrealwestonruter
andauthored
Correctly check presence with stripos
Co-authored-by: Weston Ruter <[email protected]>
1 parent 99b8733 commit 2ea6a12

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/wp-includes/customize/class-wp-customize-custom-css-setting.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public function validate( $value ) {
171171
*
172172
* @see https://html.spec.whatwg.org/multipage/parsing.html#generic-raw-text-element-parsing-algorithm
173173
*/
174-
if ( stripos( $css, '</style' ) ) {
174+
if ( false !== stripos( $css, '</style' ) ) {
175175
$validity->add( 'illegal_markup', __( 'CSS must not contain possible closing STYLE tag "</style".' ) );
176176
}
177177

src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ protected function validate_custom_css( $css ) {
677677
*
678678
* @see https://html.spec.whatwg.org/multipage/parsing.html#generic-raw-text-element-parsing-algorithm
679679
*/
680-
if ( stripos( $css, '</style' ) ) {
680+
if ( false !== stripos( $css, '</style' ) ) {
681681
return new WP_Error(
682682
'rest_custom_css_illegal_markup',
683683
__( 'Markup is not allowed in CSS.' ),

0 commit comments

Comments
 (0)