Changeset 55760 for trunk/src/wp-includes/formatting.php
- Timestamp:
- 05/16/2023 02:16:39 PM (19 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/formatting.php
r55677 r55760 2435 2435 2436 2436 /** 2437 * Strips out all characters not allowed in a locale name. 2438 * 2439 * @since 6.2.1 2440 * 2441 * @param string $locale_name The locale name to be sanitized. 2442 * @return string The sanitized value. 2443 */ 2444 function sanitize_locale_name( $locale_name ) { 2445 // Limit to A-Z, a-z, 0-9, '_', '-'. 2446 $sanitized = preg_replace( '/[^A-Za-z0-9_-]/', '', $locale_name ); 2447 2448 /** 2449 * Filters a sanitized locale name string. 2450 * 2451 * @since 6.2.1 2452 * 2453 * @param string $sanitized The sanitized locale name. 2454 * @param string $locale_name The locale name before sanitization. 2455 */ 2456 return apply_filters( 'sanitize_locale_name', $sanitized, $locale_name ); 2457 } 2458 2459 /** 2437 2460 * Converts lone & characters into `&` (a.k.a. `&`) 2438 2461 *
Note: See TracChangeset
for help on using the changeset viewer.