the-events-calendar / the-events-calendar-category-colors

Plugin add-on for The Events Calendar to colorize categories
https://wordpress.org/plugins/the-events-calendar-category-colors
44 stars 19 forks source link

Provide empty value as "" instead of NULL to avoid wp_kses_post type error #156

Closed kadamwhite closed 2 months ago

kadamwhite commented 4 months ago

wp_kses() (used here through wp_kses_post() is typed to receive a "array|string". Passing NULL causes a deprecation warning,

Deprecated: preg_replace():
Passing null to parameter #3 ($subject) of type array|string is deprecated
in /wp/wp-includes/kses.php on line 1745 [$ /usr/local/bin/wp plugin list]
[
    wp-includes/kses.php:1745 preg_replace(),
    wp-includes/kses.php:752 wp_kses_no_null(),
    wp-includes/kses.php:2172 wp_kses(),
    wp-content/plugins/the-events-calendar-category-colors/src/Category_Colors/CSS/Extras.php:164,
    ...

Changing the "empty" value to '' fixes this by ensuring the default is a string throughout.

kadamwhite commented 4 months ago

@afragen any advice about who I might be able to work with to review and merge this?

afragen commented 4 months ago

I'll ping the Slack channel I'm in with the TEC folks.