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

ensure blocks are present before processing #173

Closed psorensen closed 7 months ago

psorensen commented 7 months ago

Description of the Change

Closes #

How to test the Change

  1. Set safe_svg_optimizer_enabled filter to return true add_filter( 'safe_svg_optimizer_enabled', '__return_true' );
  2. Create a new Page, populate the page title and featured image. Do not populate any blocks.
  3. Publish the post.
  4. Page should publish without normally without issue.

Changelog Entry

Fixed fatal JS error when optimization is enabled and page is published without blocks.

Credits

Props @tictag @psorensen

Checklist:

coreyworrell commented 5 months ago

Any estimate when this will be released? Having to constantly enable/disable the plugin or comment out the filter when editing content is becoming a hassle. Thanks very much.

psorensen commented 5 months ago

@coreyworrell Hard to provide timing, but it might be worth checking out the 2.3.0 milestone https://github.com/10up/safe-svg/milestone/10 to see the list of open tasks the next release is dependent on.

Additionally, you can use the develop branch of this repo to access the latest features/fixes.

dkotter commented 5 months ago

@coreyworrell Hoping to get the next release finalized and out this week