Make WordPress Core

Changeset 61755

Timestamp:
02/27/2026 01:05:40 PM (6 days ago)
Author:
jonsurrell
Message:

HTML API: Prevent bookmark exhaustion from throwing.

When bookmark exhaustion occurs during processing, return false instead of throwing an Exception.

Developed in https://github.com/WordPress/wordpress-develop/pull/10616.

Props jonsurrell, westonruter, dmsnell.
Fixes #64394.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/html-api/class-wp-html-processor.php

    r61747 r61755  
    10431043
    10441044        if ( self::REPROCESS_CURRENT_NODE !== $node_to_process ) {
     1045
     1046
     1047
     1048
     1049
     1050
     1051
     1052
     1053
    10451054            $this->state->current_token = new WP_HTML_Token(
    1046                 $this->bookmark_token(),
     1055                $,
    10471056                $token_name,
    10481057                $this->has_self_closing_flag(),
     
    11541163             */
    11551164            return false;
     1165
     1166
     1167
     1168
     1169
     1170
    11561171        }
    11571172    }
     
    63156330     *
    63166331     * @since 6.7.0
     6332
     6333
    63176334     *
    63186335     * @param string      $token_name    Name of token to create and insert into the stack of open elements.
  • trunk/tests/phpunit/tests/html-api/wpHtmlProcessor.php

    r60887 r61755  
    10691069     * Ensure that lowercased tag_name query matches tags case-insensitively.
    10701070     *
    1071      * @group 62427
     1071     * @ 62427
    10721072     */
    10731073    public function test_next_tag_lowercase_tag_name() {
     
    10801080        $this->assertTrue( $processor->next_tag( array( 'tag_name' => 'rect' ) ) );
    10811081    }
     1082
     1083
     1084
     1085
     1086
     1087
     1088
     1089
     1090
     1091
     1092
     1093
     1094
     1095
     1096
     1097
     1098
     1099
     1100
     1101
     1102
     1103
     1104
     1105
     1106
     1107
     1108
     1109
     1110
     1111
     1112
     1113
     1114
     1115
     1116
     1117
     1118
     1119
     1120
     1121
     1122
     1123
     1124
     1125
     1126
     1127
     1128
     1129
     1130
     1131
     1132
     1133
     1134
     1135
     1136
     1137
     1138
     1139
     1140
     1141
     1142
     1143
     1144
     1145
     1146
     1147
     1148
     1149
     1150
     1151
     1152
     1153
     1154
     1155
     1156
     1157
     1158
     1159
     1160
     1161
     1162
     1163
     1164
     1165
     1166
     1167
     1168
     1169
     1170
     1171
     1172
     1173
     1174
     1175
     1176
     1177
     1178
     1179
     1180
     1181
     1182
     1183
    10821184}
Note: See TracChangeset for help on using the changeset viewer.