Skip to content

Commit ea6f7d3

Browse files
committed
Improve comment explaining early return logic
1 parent 0456be7 commit ea6f7d3

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1497,15 +1497,15 @@ private function skip_script_data(): bool {
14971497
$at += strcspn( $html, '-<', $at );
14981498

14991499
/*
1500-
* Ultimately a SCRIPT closer (`</script>`) must be found or this function will
1501-
* return false. This removes the need for additional length checks and allows
1502-
* for an early return if it's impossible to find a closer.
1500+
* A SCRIPT close tag `</script>` must be found or this function will
1501+
* return false. If a close tag would not fit in the remaining string,
1502+
* no further work is necessary.
15031503
*
1504-
* $at is potentially here
1505-
* ↓
1506-
* </script>
1507-
* ╰──┬───╯
1508-
* $at + 8 additional characters is the minimum length required to skip script data.
1504+
* $at is potentially here
1505+
*
1506+
* </script>
1507+
* ╰──┬───╯
1508+
* $at + 8 additional characters is the minimum length required to skip script data.
15091509
*/
15101510
if ( $at + 8 >= $doc_length ) {
15111511
return false;

0 commit comments

Comments
 (0)