Skip to content

Commit 0337b13

Browse files
committed
Handle Exception thrown by bookmark_token()
1 parent da53752 commit 0337b13

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1040,8 +1040,17 @@ public function step( $node_to_process = self::PROCESS_NEXT_NODE ): bool {
10401040
$token_name = $this->get_token_name();
10411041

10421042
if ( self::REPROCESS_CURRENT_NODE !== $node_to_process ) {
1043+
try {
1044+
$bookmark_name = $this->bookmark_token();
1045+
} catch ( Exception $e ) {
1046+
if ( self::ERROR_EXCEEDED_MAX_BOOKMARKS === $this->last_error ) {
1047+
return false;
1048+
}
1049+
throw $e;
1050+
}
1051+
10431052
$this->state->current_token = new WP_HTML_Token(
1044-
$this->bookmark_token(),
1053+
$bookmark_name,
10451054
$token_name,
10461055
$this->has_self_closing_flag(),
10471056
$this->release_internal_bookmark_on_destruct

0 commit comments

Comments
 (0)