Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-07-24 18:10:11 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-07-24 18:10:11 +0300
commit7308ec9d13fb69018200a40f287e76ef499ed47c (patch)
tree06c75f7ddceebd61d09f925a48fef2789338f3cd /lib
parentf296f23500b4b3758670ae0c5ce2e1779f533e8b (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/gon_helper.rb1
-rw-r--r--lib/gitlab/regex.rb4
-rw-r--r--lib/gitlab/usage/metrics/instrumentations/work_items_activity_aggregated_metric.rb13
-rw-r--r--lib/gitlab/usage_data_counters/work_item_activity_unique_counter.rb2
-rw-r--r--lib/slack_markdown_sanitizer.rb4
5 files changed, 10 insertions, 14 deletions
diff --git a/lib/gitlab/gon_helper.rb b/lib/gitlab/gon_helper.rb
index ff171c24549..fe2fa892058 100644
--- a/lib/gitlab/gon_helper.rb
+++ b/lib/gitlab/gon_helper.rb
@@ -76,6 +76,7 @@ module Gitlab
push_frontend_feature_flag(:remove_monitor_metrics)
push_frontend_feature_flag(:gitlab_duo, current_user)
push_frontend_feature_flag(:custom_emoji)
+ push_frontend_feature_flag(:super_sidebar_flyout_menus, current_user)
end
# Exposes the state of a feature flag to the frontend code.
diff --git a/lib/gitlab/regex.rb b/lib/gitlab/regex.rb
index d35df7e7cb9..ed1f134ff70 100644
--- a/lib/gitlab/regex.rb
+++ b/lib/gitlab/regex.rb
@@ -259,6 +259,10 @@ module Gitlab
@sha256_regex ||= /\A[0-9a-f]{64}\z/i.freeze
end
+ def slack_link_regex
+ @slack_link_regex ||= /<(.*[|].*)>/i.freeze
+ end
+
private
def conan_name_regex
diff --git a/lib/gitlab/usage/metrics/instrumentations/work_items_activity_aggregated_metric.rb b/lib/gitlab/usage/metrics/instrumentations/work_items_activity_aggregated_metric.rb
deleted file mode 100644
index d045265495a..00000000000
--- a/lib/gitlab/usage/metrics/instrumentations/work_items_activity_aggregated_metric.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module Usage
- module Metrics
- module Instrumentations
- class WorkItemsActivityAggregatedMetric < AggregatedMetric
- available? { Feature.enabled?(:track_work_items_activity) }
- end
- end
- end
- end
-end
diff --git a/lib/gitlab/usage_data_counters/work_item_activity_unique_counter.rb b/lib/gitlab/usage_data_counters/work_item_activity_unique_counter.rb
index 9de575d8567..b99c9ebb24f 100644
--- a/lib/gitlab/usage_data_counters/work_item_activity_unique_counter.rb
+++ b/lib/gitlab/usage_data_counters/work_item_activity_unique_counter.rb
@@ -33,7 +33,7 @@ module Gitlab
private
def track_unique_action(action, author)
- return unless author && Feature.enabled?(:track_work_items_activity)
+ return unless author
Gitlab::UsageDataCounters::HLLRedisCounter.track_event(action, values: author.id)
end
diff --git a/lib/slack_markdown_sanitizer.rb b/lib/slack_markdown_sanitizer.rb
index df3bec1a3c8..f26d9aeb688 100644
--- a/lib/slack_markdown_sanitizer.rb
+++ b/lib/slack_markdown_sanitizer.rb
@@ -8,4 +8,8 @@ module SlackMarkdownSanitizer
def self.sanitize(string)
string&.delete(UNSAFE_MARKUP_CHARACTERS)
end
+
+ def self.sanitize_slack_link(string)
+ string.gsub(Gitlab::Regex.slack_link_regex) { |m| m.gsub("<", "&lt;").gsub(">", "&gt;") }
+ end
end