Skip to content

Commit 3052284

Browse files
committed
Apply script tag escaping in case of <script
1 parent c0b870f commit 3052284

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/wp-includes/html-api/class-wp-html-tag-processor.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3735,7 +3735,10 @@ public function set_modifiable_text( string $plaintext_content ): bool {
37353735
* properly escape these things, but this could mask regex patterns
37363736
* that previously worked. Resolve this by not sending `</script`
37373737
*/
3738-
if ( false !== stripos( $plaintext_content, '</script' ) ) {
3738+
if (
3739+
false !== stripos( $plaintext_content, '</script' ) ||
3740+
false !== stripos( $plaintext_content, '<script' )
3741+
) {
37393742
/*
37403743
* JavaScript can be safely escaped.
37413744
* Non-JavaScript script tags have unknown semantics.

0 commit comments

Comments
 (0)