Changeset 52234
- Timestamp:
- 11/23/2021 06:37:03 PM (18 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/kses.php
r52229 r52234 1143 1143 * in the returned code as well. 1144 1144 * 1145 * An array of allowed values can be defined for attributes. If the attribute value 1146 * doesn't fall into the list, the attribute will be removed from the tag. 1147 * 1148 * Attributes can be marked as required. If a required attribute is not present, 1149 * KSES will remove all attributes from the tag. As KSES doesn't match opening and 1150 * closing tags, it's not possible to safely remove the tag itself, the safest 1151 * fallback is to strip all attributes from the tag, instead. 1152 * 1145 1153 * @since 1.0.0 1154 * @since 5.9.0 Added support for an array of allowed values for attributes. 1155 * Added support for required attributes. 1146 1156 * 1147 1157 * @param string $element HTML element/tag. … … 1181 1191 ); 1182 1192 1183 // If a required attribute check fails, we can return nothing for a self-closing tag, 1184 // but for a non-self-closing tag the best option is to return the element with attributes, 1185 // as KSES doesn't handle matching the relevant closing tag. 1193 /* 1194 * If a required attribute check fails, we can return nothing for a self-closing tag, 1195 * but for a non-self-closing tag the best option is to return the element with attributes, 1196 * as KSES doesn't handle matching the relevant closing tag. 1197 */ 1186 1198 $stripped_tag = ''; 1187 1199 if ( empty( $xhtml_slash ) ) { … … 1189 1201 } 1190 1202 1191 // Go through $attrarr, and save the allowed attributes for this element 1192 // in $attr2. 1203 // Go through $attrarr, and save the allowed attributes for this element in $attr2. 1193 1204 $attr2 = ''; 1194 1205 foreach ( $attrarr as $arreach ) {
Note: See TracChangeset
for help on using the changeset viewer.