Ticket #54160: 54160.diff
| File 54160.diff, 1.1 KB (added by , 5 years ago) |
|---|
-
wp-includes/formatting.php
function sanitize_user( $username, $stri 2125 2125 } 2126 2126 2127 2127 /** 2128 2128 * Sanitizes a string key. 2129 2129 * 2130 2130 * Keys are used as internal identifiers. Lowercase alphanumeric characters, 2131 2131 * dashes, and underscores are allowed. 2132 2132 * 2133 2133 * @since 3.0.0 2134 2134 * 2135 2135 * @param string $key String key 2136 2136 * @return string Sanitized key 2137 2137 */ 2138 2138 function sanitize_key( $key ) { 2139 2139 $raw_key = $key; 2140 $key = strtolower( $key ); 2141 $key = preg_replace( '/[^a-z0-9_\-]/', '', $key ); 2140 if ( ! is_string( $key ) ) { 2141 $key = ''; 2142 } 2143 2144 $key = strtolower( $key ); 2145 $key = preg_replace( '/[^a-z0-9_\-]/', '', $key ); 2142 2146 2143 2147 /** 2144 2148 * Filters a sanitized key string. 2145 2149 * 2146 2150 * @since 3.0.0 2147 2151 * 2148 2152 * @param string $key Sanitized key. 2149 2153 * @param string $raw_key The key prior to sanitization. 2150 2154 */ 2151 2155 return apply_filters( 'sanitize_key', $key, $raw_key ); 2152 2156 } 2153 2157 2154 2158 /** 2155 2159 * Sanitizes a string into a slug, which can be used in URLs or HTML attributes. 2156 2160 *
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)