Skip to content

Commit bd6e249

Browse files
committed
HTML API: Check tag namespace in ::set_modifiable_text().
The method should only apply to special "atomic" HTML tags like `SCRIPT` or `TEXTAREA`. `::set_modifiable_text()` should not apply to tags with the same name in other namespaces. Developed in WordPress/wordpress-develop#11083. Props jonsurrell, dmsnell, westonruter. Fixes #64751. Built from https://develop.svn.wordpress.org/trunk@61796 git-svn-id: http://core.svn.wordpress.org/trunk@61102 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 parent 90d7aad commit bd6e249

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3817,7 +3817,14 @@ public function set_modifiable_text( string $plaintext_content ): bool {
38173817
return true;
38183818
}
38193819

3820-
if ( self::STATE_MATCHED_TAG !== $this->parser_state ) {
3820+
/*
3821+
* The rest of this function handles modifiable text for special "atomic" HTML elements.
3822+
* Only tags in the HTML namespace should be processed.
3823+
*/
3824+
if (
3825+
self::STATE_MATCHED_TAG !== $this->parser_state ||
3826+
'html' !== $this->get_namespace()
3827+
) {
38213828
return false;
38223829
}
38233830

wp-includes/version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* @global string $wp_version
1818
*/
19-
$wp_version = '7.0-beta2-61795';
19+
$wp_version = '7.0-beta2-61796';
2020

2121
/**
2222
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

0 commit comments

Comments
 (0)