Skip to content

Commit

Permalink
advanced heading generated block security checks
Browse files Browse the repository at this point in the history
  • Loading branch information
erdembircan committed Apr 16, 2024
1 parent f18de77 commit c4cf188
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dist/blocks.build.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wp-api', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-primitives', 'wp-url'), 'version' => 'f26bc69e622f96651599');
<?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wp-api', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-primitives', 'wp-url'), 'version' => 'd050deddcfeedb124ab0');
4 changes: 3 additions & 1 deletion src/blocks/advanced-heading/block.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ function ub_render_advanced_heading_block( $attributes ) {
$cleaned_content = preg_replace( '/<img[^>]+>/i', '', $content );
$cleaned_content = preg_replace( '/<script[^>]*?>.*?<\/script>/is', '', $cleaned_content );

return '<' . $level . ' ' . $block_wrapper_attributes . ' data-blockid="' . $blockID . '">' . $cleaned_content . '</' . $level . '>';
$final_content = '<' . $level . ' ' . $block_wrapper_attributes . ' data-blockid="' . $blockID . '">' . $cleaned_content . '</' . $level . '>';

return wp_kses_post( $final_content );
}

function ub_register_advanced_heading_block() {
Expand Down

0 comments on commit c4cf188

Please sign in to comment.