mirror of
https://github.com/WordPress/WordPress.git
synced 2024-07-01 01:05:06 +02:00
HTML API: Fix finding RCData and Script tag closers.
Fixes finding the following tag closers `</script>`, `</textarea>`, and `</title>` in `WP_HTML_Tag_Processor`. Follow-up to [55407], [55203]. Props zieladam, dmsnell, hellofromTonya. Fixes #57852. See #57575. Built from https://develop.svn.wordpress.org/trunk@55469 git-svn-id: http://core.svn.wordpress.org/trunk@55002 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
c2cd23a06b
commit
39308664bf
|
@ -775,6 +775,7 @@ class WP_HTML_Tag_Processor {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$closer_potentially_starts_at = $at;
|
||||||
$at += 2;
|
$at += 2;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -818,7 +819,7 @@ class WP_HTML_Tag_Processor {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( '>' === $html[ $at ] || '/' === $html[ $at ] ) {
|
if ( '>' === $html[ $at ] || '/' === $html[ $at ] ) {
|
||||||
++$this->bytes_already_parsed;
|
$this->bytes_already_parsed = $closer_potentially_starts_at;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -887,6 +888,7 @@ class WP_HTML_Tag_Processor {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( '/' === $html[ $at ] ) {
|
if ( '/' === $html[ $at ] ) {
|
||||||
|
$closer_potentially_starts_at = $at - 1;
|
||||||
$is_closing = true;
|
$is_closing = true;
|
||||||
++$at;
|
++$at;
|
||||||
} else {
|
} else {
|
||||||
|
@ -938,7 +940,7 @@ class WP_HTML_Tag_Processor {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $is_closing ) {
|
if ( $is_closing ) {
|
||||||
$this->bytes_already_parsed = $at;
|
$this->bytes_already_parsed = $closer_potentially_starts_at;
|
||||||
if ( $this->bytes_already_parsed >= $doc_length ) {
|
if ( $this->bytes_already_parsed >= $doc_length ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -948,7 +950,7 @@ class WP_HTML_Tag_Processor {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( '>' === $html[ $this->bytes_already_parsed ] ) {
|
if ( '>' === $html[ $this->bytes_already_parsed ] ) {
|
||||||
++$this->bytes_already_parsed;
|
$this->bytes_already_parsed = $closer_potentially_starts_at;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '6.2-beta4-55468';
|
$wp_version = '6.2-beta4-55469';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user