We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9e7167a commit 1270194Copy full SHA for 1270194
src/wp-includes/html-api/class-wp-html-tag-processor.php
@@ -1267,6 +1267,12 @@ private function skip_script_data() {
1267
continue;
1268
}
1269
1270
+ if ( $this->bytes_already_parsed >= $doc_length ) {
1271
+ $this->parser_state = self::STATE_INCOMPLETE;
1272
+
1273
+ return false;
1274
+ }
1275
1276
if ( '>' === $html[ $this->bytes_already_parsed ] ) {
1277
$this->bytes_already_parsed = $closer_potentially_starts_at;
1278
return true;
@@ -1362,7 +1368,7 @@ private function parse_next_tag() {
1362
1368
* https://html.spec.whatwg.org/multipage/parsing.html#tag-open-state
1363
1369
*/
1364
1370
if (
1365
- strlen( $html ) > $at + 3 &&
1371
+ $doc_length > $at + 3 &&
1366
1372
'-' === $html[ $at + 2 ] &&
1367
1373
'-' === $html[ $at + 3 ]
1374
) {
0 commit comments