Commit 3a75b01c authored by Ezekiel Kigbo's avatar Ezekiel Kigbo

Merge branch 'issue_241884' into 'master'

Replace v-html with v-safe-html to improve frontend security posture

See merge request gitlab-org/gitlab!72912
parents dbdbaa51 809b1271
<script> <script>
import { GlButton, GlSkeletonLoader } from '@gitlab/ui'; import { GlButton, GlSkeletonLoader } from '@gitlab/ui';
import { escape } from 'lodash';
import createFlash from '~/flash'; import createFlash from '~/flash';
import { __, sprintf } from '~/locale'; import { __ } from '~/locale';
import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import simplePoll from '../../../lib/utils/simple_poll'; import simplePoll from '../../../lib/utils/simple_poll';
import eventHub from '../../event_hub'; import eventHub from '../../event_hub';
...@@ -85,13 +84,7 @@ export default { ...@@ -85,13 +84,7 @@ export default {
return ['failed', 'loading'].includes(this.status); return ['failed', 'loading'].includes(this.status);
}, },
fastForwardMergeText() { fastForwardMergeText() {
return sprintf( return __('Merge blocked: the source branch must be rebased onto the target branch.');
__('Merge blocked: the source branch must be rebased onto the target branch.'),
{
targetBranch: `<span class="label-branch">${escape(this.targetBranch)}</span>`,
},
false,
);
}, },
}, },
methods: { methods: {
...@@ -170,8 +163,8 @@ export default { ...@@ -170,8 +163,8 @@ export default {
v-if="!rebaseInProgress && !canPushToSourceBranch" v-if="!rebaseInProgress && !canPushToSourceBranch"
class="gl-font-weight-bold gl-ml-0!" class="gl-font-weight-bold gl-ml-0!"
data-testid="rebase-message" data-testid="rebase-message"
v-html="fastForwardMergeText /* eslint-disable-line vue/no-v-html */" >{{ fastForwardMergeText }}</span
></span> >
<div <div
v-if="!rebaseInProgress && canPushToSourceBranch && !isMakingRequest" v-if="!rebaseInProgress && canPushToSourceBranch && !isMakingRequest"
class="accept-merge-holder clearfix js-toggle-container accept-action media space-children" class="accept-merge-holder clearfix js-toggle-container accept-action media space-children"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment