Changeset 55162
- Timestamp:
- 01/30/2023 02:13:49 PM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/formatting.php
r55051 r55162 2406 2406 * @since 2.8.0 2407 2407 * 2408 * @param string $class The classname to be sanitized2409 * @param string $fallback Optional. The value to return if the sanitization ends up as an empty string.2410 * Defaults to anempty string.2411 * @return string The sanitized value 2412 */ 2413 function sanitize_html_class( $class , $fallback = '' ) {2408 * @param string $classname The classname to be sanitized. 2409 * @param string $fallback Optional. The value to return if the sanitization ends up as an empty string. 2410 * Default empty string. 2411 * @return string The sanitized value. 2412 */ 2413 function sanitize_html_class( $classname, $fallback = '' ) { 2414 2414 // Strip out any %-encoded octets. 2415 $sanitized = preg_replace( '|%[a-fA-F0-9][a-fA-F0-9]|', '', $class );2415 $sanitized = preg_replace( '|%[a-fA-F0-9][a-fA-F0-9]|', '', $classname ); 2416 2416 2417 2417 // Limit to A-Z, a-z, 0-9, '_', '-'. … … 2427 2427 * 2428 2428 * @param string $sanitized The sanitized HTML class. 2429 * @param string $class 2429 * @param string $classname HTML class before sanitization. 2430 2430 * @param string $fallback The fallback string. 2431 2431 */ 2432 return apply_filters( 'sanitize_html_class', $sanitized, $class , $fallback );2432 return apply_filters( 'sanitize_html_class', $sanitized, $classname, $fallback ); 2433 2433 } 2434 2434
Note: See TracChangeset
for help on using the changeset viewer.