Changeset 3708608
- Timestamp:
- 09/23/2026 06:21:21 AM (4 weeks ago)
- Location:
- ditty-news-ticker
- Files:
-
- 8 edited
- 1 copied
-
tags/3.1.71 (copied) (copied from ditty-news-ticker/trunk )
-
tags/3.1.71/ditty-news-ticker.php (modified) (2 diffs)
-
tags/3.1.71/includes/class-ditty-singles.php (modified) (2 diffs)
-
tags/3.1.71/includes/helpers.php (modified) (1 diff)
-
tags/3.1.71/readme.txt (modified) (2 diffs)
-
trunk/ditty-news-ticker.php (modified) (2 diffs)
-
trunk/includes/class-ditty-singles.php (modified) (2 diffs)
-
trunk/includes/helpers.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ditty-news-ticker/tags/3.1.71/ditty-news-ticker.php
r3705336 r3708608 5 5 * Plugin URI: https://www.metaphorcreations.com/ditty 6 6 * Description: Ditty offers a range of content display options, including its signature news ticker and customizable layouts. 7 * Version: 3.1.7 07 * Version: 3.1.71 8 8 * Author: Metaphor Creations 9 9 * Author URI: https://www.metaphorcreations.com … … 24 24 // Plugin version. 25 25 if ( ! defined( 'DITTY_VERSION' ) ) { 26 define( 'DITTY_VERSION', '3.1.7 0' );26 define( 'DITTY_VERSION', '3.1.71' ); 27 27 } 28 28 -
ditty-news-ticker/tags/3.1.71/includes/class-ditty-singles.php
r3538064 r3708608 188 188 if ( '' != $display_settings && 'false' != $display_settings ) { 189 189 parse_str( html_entity_decode( $display_settings ), $custom_display_settings ); 190 $custom_display_settings = ditty_sanitize_custom_display_settings( $custom_display_settings ); 190 191 if ( is_array( $custom_display_settings ) && count( $custom_display_settings ) > 0 ) { 191 192 foreach ( $custom_display_settings as $key => $value ) { 193 if ( is_array( $value ) ) { 194 continue; 195 } 192 196 $parts = explode( '|', $value ); 193 197 if ( is_array( $parts ) && count( $parts ) > 0 ) { … … 368 372 $display_type = $custom_display_array['type']; 369 373 } 370 if ( isset( $custom_display_array['settings'] ) ) { 371 $args = wp_parse_args( $custom_display_array['settings'], $args ); 374 if ( isset( $custom_display_array['settings'] ) && is_array( $custom_display_array['settings'] ) ) { 375 $custom_display_settings_array = ditty_sanitize_custom_display_settings( $custom_display_array['settings'] ); 376 $args = wp_parse_args( $custom_display_settings_array, $args ); 372 377 } 373 378 } else { -
ditty-news-ticker/tags/3.1.71/includes/helpers.php
r3661664 r3708608 1588 1588 1589 1589 /** 1590 * Return setting keys that can't be set through custom display settings 1591 * 1592 * These values are always generated by Ditty. The display scripts render some 1593 * of them as HTML, so they can't be overwritten from a shortcode, block or 1594 * ajax request. 1595 * * 1596 * @since 3.1.70 1597 */ 1598 function ditty_protected_display_setting_keys() { 1599 return apply_filters( 'ditty_protected_display_setting_keys', array( 1600 'id', 1601 'uniqid', 1602 'title', 1603 'status', 1604 'display', 1605 'items', 1606 'showEditor', 1607 ) ); 1608 } 1609 1610 /** 1611 * Sanitize custom display settings from a shortcode, block or ajax request 1612 * * 1613 * @since 3.1.70 1614 */ 1615 function ditty_sanitize_custom_display_settings( $settings, $depth = 0 ) { 1616 if ( ! is_array( $settings ) || $depth > 5 ) { 1617 return array(); 1618 } 1619 1620 $protected_keys = array_map( 'strtolower', ditty_protected_display_setting_keys() ); 1621 $sanitized_settings = array(); 1622 foreach ( $settings as $key => $value ) { 1623 if ( is_string( $key ) ) { 1624 $key = preg_replace( '/[^a-zA-Z0-9_\-]/', '', $key ); 1625 if ( '' === $key ) { 1626 continue; 1627 } 1628 if ( 0 === $depth && in_array( strtolower( $key ), $protected_keys, true ) ) { 1629 continue; 1630 } 1631 } elseif ( ! is_int( $key ) ) { 1632 continue; 1633 } 1634 1635 if ( is_array( $value ) ) { 1636 $sanitized_settings[$key] = ditty_sanitize_custom_display_settings( $value, $depth + 1 ); 1637 } elseif ( is_bool( $value ) || is_int( $value ) || is_float( $value ) || is_null( $value ) ) { 1638 $sanitized_settings[$key] = $value; 1639 } else { 1640 $sanitized_settings[$key] = sanitize_text_field( $value ); 1641 } 1642 } 1643 return $sanitized_settings; 1644 } 1645 1646 /** 1590 1647 * Make sure an image url is safe 1591 1648 */ -
ditty-news-ticker/tags/3.1.71/readme.txt
r3705336 r3708608 6 6 Requires PHP: 7.4 7 7 Tested up to: 7.1.1 8 Stable tag: 3.1.7 08 Stable tag: 3.1.71 9 9 License: GPL2 10 10 … … 135 135 136 136 == Changelog == 137 138 = 3.1.71 [2026-09-23] = 139 * Security fix: sanitize custom display settings and block protected keys passed via shortcodes, blocks and AJAX 137 140 138 141 = 3.1.70 [2026-09-21] = -
ditty-news-ticker/trunk/ditty-news-ticker.php
r3705336 r3708608 5 5 * Plugin URI: https://www.metaphorcreations.com/ditty 6 6 * Description: Ditty offers a range of content display options, including its signature news ticker and customizable layouts. 7 * Version: 3.1.7 07 * Version: 3.1.71 8 8 * Author: Metaphor Creations 9 9 * Author URI: https://www.metaphorcreations.com … … 24 24 // Plugin version. 25 25 if ( ! defined( 'DITTY_VERSION' ) ) { 26 define( 'DITTY_VERSION', '3.1.7 0' );26 define( 'DITTY_VERSION', '3.1.71' ); 27 27 } 28 28 -
ditty-news-ticker/trunk/includes/class-ditty-singles.php
r3538064 r3708608 188 188 if ( '' != $display_settings && 'false' != $display_settings ) { 189 189 parse_str( html_entity_decode( $display_settings ), $custom_display_settings ); 190 $custom_display_settings = ditty_sanitize_custom_display_settings( $custom_display_settings ); 190 191 if ( is_array( $custom_display_settings ) && count( $custom_display_settings ) > 0 ) { 191 192 foreach ( $custom_display_settings as $key => $value ) { 193 if ( is_array( $value ) ) { 194 continue; 195 } 192 196 $parts = explode( '|', $value ); 193 197 if ( is_array( $parts ) && count( $parts ) > 0 ) { … … 368 372 $display_type = $custom_display_array['type']; 369 373 } 370 if ( isset( $custom_display_array['settings'] ) ) { 371 $args = wp_parse_args( $custom_display_array['settings'], $args ); 374 if ( isset( $custom_display_array['settings'] ) && is_array( $custom_display_array['settings'] ) ) { 375 $custom_display_settings_array = ditty_sanitize_custom_display_settings( $custom_display_array['settings'] ); 376 $args = wp_parse_args( $custom_display_settings_array, $args ); 372 377 } 373 378 } else { -
ditty-news-ticker/trunk/includes/helpers.php
r3661664 r3708608 1588 1588 1589 1589 /** 1590 * Return setting keys that can't be set through custom display settings 1591 * 1592 * These values are always generated by Ditty. The display scripts render some 1593 * of them as HTML, so they can't be overwritten from a shortcode, block or 1594 * ajax request. 1595 * * 1596 * @since 3.1.70 1597 */ 1598 function ditty_protected_display_setting_keys() { 1599 return apply_filters( 'ditty_protected_display_setting_keys', array( 1600 'id', 1601 'uniqid', 1602 'title', 1603 'status', 1604 'display', 1605 'items', 1606 'showEditor', 1607 ) ); 1608 } 1609 1610 /** 1611 * Sanitize custom display settings from a shortcode, block or ajax request 1612 * * 1613 * @since 3.1.70 1614 */ 1615 function ditty_sanitize_custom_display_settings( $settings, $depth = 0 ) { 1616 if ( ! is_array( $settings ) || $depth > 5 ) { 1617 return array(); 1618 } 1619 1620 $protected_keys = array_map( 'strtolower', ditty_protected_display_setting_keys() ); 1621 $sanitized_settings = array(); 1622 foreach ( $settings as $key => $value ) { 1623 if ( is_string( $key ) ) { 1624 $key = preg_replace( '/[^a-zA-Z0-9_\-]/', '', $key ); 1625 if ( '' === $key ) { 1626 continue; 1627 } 1628 if ( 0 === $depth && in_array( strtolower( $key ), $protected_keys, true ) ) { 1629 continue; 1630 } 1631 } elseif ( ! is_int( $key ) ) { 1632 continue; 1633 } 1634 1635 if ( is_array( $value ) ) { 1636 $sanitized_settings[$key] = ditty_sanitize_custom_display_settings( $value, $depth + 1 ); 1637 } elseif ( is_bool( $value ) || is_int( $value ) || is_float( $value ) || is_null( $value ) ) { 1638 $sanitized_settings[$key] = $value; 1639 } else { 1640 $sanitized_settings[$key] = sanitize_text_field( $value ); 1641 } 1642 } 1643 return $sanitized_settings; 1644 } 1645 1646 /** 1590 1647 * Make sure an image url is safe 1591 1648 */ -
ditty-news-ticker/trunk/readme.txt
r3705336 r3708608 6 6 Requires PHP: 7.4 7 7 Tested up to: 7.1.1 8 Stable tag: 3.1.7 08 Stable tag: 3.1.71 9 9 License: GPL2 10 10 … … 135 135 136 136 == Changelog == 137 138 = 3.1.71 [2026-09-23] = 139 * Security fix: sanitize custom display settings and block protected keys passed via shortcodes, blocks and AJAX 137 140 138 141 = 3.1.70 [2026-09-21] =
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)