Changeset 52292
- Timestamp:
- 11/30/2021 08:09:56 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 1 edited
-
src/wp-includes/formatting.php (modified) (1 diff)
-
tests/phpunit/tests/formatting/sanitizeKey.php (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/formatting.php
r52188 r52292 2138 2138 function sanitize_key( $key ) { 2139 2139 $raw_key = $key; 2140 $key = strtolower( $key ); 2141 $key = preg_replace( '/[^a-z0-9_\-]/', '', $key ); 2140 2141 if ( ! is_string( $key ) ) { 2142 $key = ''; 2143 } 2144 2145 if ( '' !== $key ) { 2146 $key = strtolower( $key ); 2147 $key = preg_replace( '/[^a-z0-9_\-]/', '', $key ); 2148 } 2142 2149 2143 2150 /**
Note: See TracChangeset
for help on using the changeset viewer.