Changeset 46793 for trunk/src/wp-includes/kses.php
- Timestamp:
- 11/28/2019 12:27:21 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/kses.php
r46660 r46793 2074 2074 * @since 5.3.0 Added support for `grid`, `flex` and `column` layout properties. 2075 2075 * Extend `background-*` support of individual properties. 2076 * @since 5.3.1 Added support for gradient backgrounds. 2076 2077 * 2077 2078 * @param string[] $attr Array of allowed CSS attributes. … … 2210 2211 ); 2211 2212 2213 /* 2214 * CSS attributes that accept gradient data types. 2215 * 2216 */ 2217 $css_gradient_data_types = array( 2218 'background', 2219 'background-image', 2220 ); 2221 2212 2222 if ( empty( $allowed_attr ) ) { 2213 2223 return $css; … … 2224 2234 $found = false; 2225 2235 $url_attr = false; 2236 $gradient_attr = false; 2226 2237 2227 2238 if ( strpos( $css_item, ':' ) === false ) { … … 2232 2243 2233 2244 if ( in_array( $css_selector, $allowed_attr, true ) ) { 2234 $found = true; 2235 $url_attr = in_array( $css_selector, $css_url_data_types, true ); 2245 $found = true; 2246 $url_attr = in_array( $css_selector, $css_url_data_types, true ); 2247 $gradient_attr = in_array( $css_selector, $css_gradient_data_types, true ); 2236 2248 } 2237 2249 } … … 2259 2271 $css_test_string = str_replace( $url_match, '', $css_test_string ); 2260 2272 } 2273 } 2274 } 2275 2276 if ( $found && $gradient_attr ) { 2277 $css_value = trim( $parts[1] ); 2278 if ( preg_match( '/^(repeating-)?(linear|radial|conic)-gradient\(([^()]|rgb[a]?\([^()]*\))*\)$/', $css_value ) ) { 2279 // Remove the whole `gradient` bit that was matched above from the CSS. 2280 $css_test_string = str_replace( $css_value, '', $css_test_string ); 2261 2281 } 2262 2282 }
Note: See TracChangeset
for help on using the changeset viewer.