Skip to content

Commit 67250a0

Browse files
committed
Revert initial regex search
1 parent 554cfc0 commit 67250a0

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
@@ -3839,7 +3839,10 @@ public function set_modifiable_text( string $plaintext_content ): bool {
38393839
*
38403840
* @see https://html.spec.whatwg.org/multipage/parsing.html#script-data-double-escaped-state
38413841
*/
3842-
if ( preg_match( '~</?script[\t\r\n\f />]~i', $plaintext_content ) ) {
3842+
if (
3843+
false !== stripos( $plaintext_content, '</script' ) ||
3844+
false !== stripos( $plaintext_content, '<script' )
3845+
) {
38433846
/*
38443847
* JavaScript can be safely escaped.
38453848
* Non-JavaScript script tags have unknown semantics.

0 commit comments

Comments
 (0)