Changeset 62433 for trunk/src/wp-includes/kses.php
- Timestamp:
- 05/31/2026 07:30:28 AM (39 hours ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/kses.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/kses.php
r61882 r62433 1557 1557 1558 1558 if ( 'style' === $name_low ) { 1559 $new_value = safecss_filter_attr( $value ); 1559 $decoded_value = WP_HTML_Decoder::decode_attribute( $value ); 1560 $new_value = safecss_filter_attr( $decoded_value ); 1560 1561 1561 1562 if ( empty( $new_value ) ) { … … 1566 1567 } 1567 1568 1568 $whole = str_replace( $value, $new_value, $whole ); 1569 $value = $new_value; 1569 if ( $new_value !== $decoded_value ) { 1570 $encoded_value = esc_attr( $new_value ); 1571 $whole = str_replace( $value, $encoded_value, $whole ); 1572 $value = $encoded_value; 1573 } 1570 1574 } 1571 1575 … … 2555 2559 * @since 6.9.0 Added support for `white-space`. 2556 2560 * 2557 * @param string $css A string of CSS rules .2561 * @param string $css A string of CSS rules, decoded from an HTML `style` attribute. 2558 2562 * @param string $deprecated Not used. 2559 * @return string Filtered string of CSS rules .2563 * @return string Filtered string of CSS rules, needing HTML escaping before sending back to a `style` attribute. 2560 2564 */ 2561 2565 function safecss_filter_attr( $css, $deprecated = '' ) { … … 2569 2573 $allowed_protocols = wp_allowed_protocols(); 2570 2574 2575 /** @todo Parse enough CSS to split rules without breaking on things like quoted strings. */ 2571 2576 $css_array = explode( ';', trim( $css ) ); 2572 2577
Note: See TracChangeset
for help on using the changeset viewer.