Skip to content

Commit

Permalink
escape id attr
Browse files Browse the repository at this point in the history
  • Loading branch information
permafrost06 committed Jul 10, 2024
1 parent 68402d9 commit 339d2ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/extensions/custom-css/class-custom-css.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public function ub_render_custom_css($content, $block) {
$pattern = '/id=("|\')(.*?)("|\')/i';
preg_match($pattern, $matches_first_element[0], $matches);
if (!isset($matches[2])) {
$updated_content = preg_replace('/(<[^>]+)/', '$1 id="' . $block_id . '"', $content, 1);
$updated_content = preg_replace('/(<[^>]+)/', '$1 id="' . esc_attr($block_id) . '"', $content, 1);
}
}
return $updated_content;
Expand Down

0 comments on commit 339d2ee

Please sign in to comment.