Skip to content

Commit 2ab4156

Browse files
committed
use safeHTML for sanitization
1 parent ded1787 commit 2ab4156

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/plugins/page-icons/page-icons.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import './store'
22
import { useSelect } from '@wordpress/data'
3+
import { safeHTML } from '@wordpress/dom'
34

45
/**
56
* Parse SVG string to extract attributes and innerHTML without DOM manipulation
@@ -28,7 +29,7 @@ const parseSVGString = svgString => {
2829
return null
2930
}
3031

31-
const innerHTML = svgString.substring( svgTagEnd, closingTagIndex )
32+
const innerHTML = safeHTML( svgString.substring( svgTagEnd, closingTagIndex ) )
3233

3334
// Extract attributes from the SVG tag
3435
const svgAttributes = {}

0 commit comments

Comments
 (0)