diff options
Diffstat (limited to 'server/sonar-web/src/main/js/apps/overview/components/AnalysisWarningsModal.tsx')
-rw-r--r-- | server/sonar-web/src/main/js/apps/overview/components/AnalysisWarningsModal.tsx | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/server/sonar-web/src/main/js/apps/overview/components/AnalysisWarningsModal.tsx b/server/sonar-web/src/main/js/apps/overview/components/AnalysisWarningsModal.tsx index 5a4daac6b9e..3390089477d 100644 --- a/server/sonar-web/src/main/js/apps/overview/components/AnalysisWarningsModal.tsx +++ b/server/sonar-web/src/main/js/apps/overview/components/AnalysisWarningsModal.tsx @@ -17,12 +17,19 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + import { Button, ButtonVariety } from '@sonarsource/echoes-react'; -import { FlagMessage, HtmlFormatter, Modal, Spinner } from 'design-system'; +import { + FlagMessage, + HtmlFormatter, + Modal, + SafeHTMLInjection, + SanitizeLevel, + Spinner, +} from 'design-system'; import * as React from 'react'; import withCurrentUserContext from '../../../app/components/current-user/withCurrentUserContext'; import { translate } from '../../../helpers/l10n'; -import { sanitizeStringRestricted } from '../../../helpers/sanitize'; import { useDismissBranchWarningMutation } from '../../../queries/branch'; import { TaskWarning } from '../../../types/tasks'; import { Component } from '../../../types/types'; @@ -51,11 +58,9 @@ export function AnalysisWarningsModal(props: Props) { <div className="sw-flex sw-items-center sw-mt-2"> <FlagMessage variant="warning"> <HtmlFormatter> - <span - // eslint-disable-next-line react/no-danger - dangerouslySetInnerHTML={{ - __html: sanitizeStringRestricted(message.trim().replace(/\n/g, '<br />')), - }} + <SafeHTMLInjection + htmlAsString={message.trim().replace(/\n/g, '<br />')} + sanitizeLevel={SanitizeLevel.RESTRICTED} /> </HtmlFormatter> </FlagMessage> |