Skip to content
代码片段 群组 项目
未验证 提交 cfce3cdc 编辑于 作者: Ankit Panchal's avatar Ankit Panchal 提交者: GitLab
浏览文件

Merge branch '439865-sanitise-field-error' into 'master'

No related branches found
No related tags found
无相关合并请求
import $ from 'jquery';
import { sanitize } from '~/lib/dompurify';
import { __ } from '~/locale';
/**
......@@ -64,7 +65,9 @@ export default class GlFieldError {
this.inputDomElement = this.inputElement.get(0);
this.form = formErrors;
this.errorMessage = this.inputElement.attr('title') || __('This field is required.');
this.fieldErrorElement = $(`<p class='${errorMessageClass} hidden'>${this.errorMessage}</p>`);
this.fieldErrorElement = $(
`<p class='${errorMessageClass} hidden'>${sanitize(this.errorMessage)}</p>`,
);
this.state = {
valid: false,
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册