Skip to content

Commit

Permalink
Fix use of sanitizeHTML (woocommerce#7231)
Browse files Browse the repository at this point in the history
* Remove object from sanitizeHTML return value

* Import sanitizeHTML from utils

* Fix dangerously set inner HTML format

* Update package-lock

* Update package-lock

* Update package-lock

* Update @types/dompurify version

Co-authored-by: Thomas Roberts <[email protected]>
  • Loading branch information
2 people authored and senadir committed Nov 12, 2022
1 parent 55e127b commit bacfbd6
Showing 1 changed file with 0 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,6 @@ import { PAYMENT_STORE_KEY } from '@woocommerce/block-data';
*/
import './style.scss';

const ALLOWED_TAGS = [ 'a', 'b', 'em', 'i', 'strong', 'p', 'br' ];
const ALLOWED_ATTR = [ 'target', 'href', 'rel', 'name', 'download' ];

const sanitizeHTML = ( html ) => {
return {
__html: sanitize( html, { ALLOWED_TAGS, ALLOWED_ATTR } ),
};
};

const getWooClassName = ( { status = 'default' } ) => {
switch ( status ) {
case 'error':
Expand Down

0 comments on commit bacfbd6

Please sign in to comment.