10up / safe-svg

Enable SVG uploads and sanitize them to stop XML/SVG vulnerabilities in your WordPress website.
https://wordpress.org/plugins/safe-svg/
GNU General Public License v2.0
263 stars 31 forks source link

Fix fatal error when "admin_post_thumbnail_html" filter is applied with null "$thumbnail_id" param #196

Closed kmgalanakis closed 4 months ago

kmgalanakis commented 4 months ago

Description of the Change

The admin_post_thumbnail_html filter is allowing the $thumbnail_id parameter to be null or undefined but the when a callback for that hook is registered in the plugin, the $thumbnail_id parameter is set to always be defined, thus filter application with just two arguments are throwing fatal errors when the plugin is activated.

Closes #195

How to test the Change

Changelog Entry

Fixed - Fatal error when applying the "admin_post_thumbnail_html" with just two arguments.

Credits

Props @kmgalanakis

Checklist: