Skip to content

Commit

Permalink
added extra dompurify when setting search box value
Browse files Browse the repository at this point in the history
  • Loading branch information
bblaisATcoveo committed Jul 12, 2024
1 parent 3563940 commit f0426ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/connector.js
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ function updateSearchBoxState( newState ) {
searchBoxState = newState;

if ( updateSearchBoxFromState && searchBoxElement && searchBoxElement.value !== newState.value ) {
searchBoxElement.value = newState.value;
searchBoxElement.value = DOMPurify.sanitize( newState.value );
updateSearchBoxFromState = false;
return;
}
Expand All @@ -751,7 +751,7 @@ function updateSearchBoxState( newState ) {
node.setAttribute( "class", "suggestion-item" );
node.onclick = ( e ) => {
searchBoxController.selectSuggestion(e.currentTarget.innerText);
searchBoxElement.value = e.currentTarget.innerText;
searchBoxElement.value = DOMPurify.sanitize( e.currentTarget.innerText );
};
node.innerHTML = suggestion.highlightedValue;
suggestionsElement.appendChild( node );
Expand Down

0 comments on commit f0426ce

Please sign in to comment.