Changeset 55782 for branches/5.5/src/wp-includes/formatting.php
- Timestamp:
- 05/16/2023 03:43:00 PM (19 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.5/src/wp-includes/formatting.php
r52468 r55782 2370 2370 2371 2371 /** 2372 * Strips out all characters not allowed in a locale name. 2373 * 2374 * @since 6.2.1 2375 * 2376 * @param string $locale_name The locale name to be sanitized. 2377 * @return string The sanitized value. 2378 */ 2379 function sanitize_locale_name( $locale_name ) { 2380 // Limit to A-Z, a-z, 0-9, '_', '-'. 2381 $sanitized = preg_replace( '/[^A-Za-z0-9_-]/', '', $locale_name ); 2382 2383 /** 2384 * Filters a sanitized locale name string. 2385 * 2386 * @since 6.2.1 2387 * 2388 * @param string $sanitized The sanitized locale name. 2389 * @param string $locale_name The locale name before sanitization. 2390 */ 2391 return apply_filters( 'sanitize_locale_name', $sanitized, $locale_name ); 2392 } 2393 2394 /** 2372 2395 * Converts lone & characters into `&` (a.k.a. `&`) 2373 2396 *
Note: See TracChangeset
for help on using the changeset viewer.