Changeset 52370 for trunk/src/wp-includes/formatting.php
- Timestamp:
- 12/14/2021 02:59:33 PM (5 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/formatting.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/formatting.php
r52332 r52370 2133 2133 * @since 3.0.0 2134 2134 * 2135 * @param string $key String key 2136 * @return string Sanitized key 2135 * @param string $key String key. 2136 * @return string Sanitized key. 2137 2137 */ 2138 2138 function sanitize_key( $key ) { 2139 $raw_key = $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 ); 2139 $sanitized_key = ''; 2140 2141 if ( is_scalar( $key ) ) { 2142 $sanitized_key = strtolower( $key ); 2143 $sanitized_key = preg_replace( '/[^a-z0-9_\-]/', '', $sanitized_key ); 2148 2144 } 2149 2145 … … 2153 2149 * @since 3.0.0 2154 2150 * 2155 * @param string $ keySanitized key.2156 * @param string $ raw_keyThe key prior to sanitization.2151 * @param string $sanitized_key Sanitized key. 2152 * @param string $key The key prior to sanitization. 2157 2153 */ 2158 return apply_filters( 'sanitize_key', $ key, $raw_key );2154 return apply_filters( 'sanitize_key', $sanitized_key, $key ); 2159 2155 } 2160 2156
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)