Merge commit 'f378f10404' into kb_migration

This commit is contained in:
KMY 2023-06-07 11:45:52 +09:00
commit edb2a5dcf3
153 changed files with 1225 additions and 1025 deletions

View file

@ -77,8 +77,8 @@ class BackupService < BaseService
path = m.file&.path
next unless path
path = path.gsub(/\A.*\/system\//, '')
path = path.gsub(/\A\/+/, '')
path = path.gsub(%r{\A.*/system/}, '')
path = path.gsub(%r{\A/+}, '')
download_to_zip(zipfile, m.file, path)
end

View file

@ -7,7 +7,7 @@ class FetchLinkCardService < BaseService
URL_PATTERN = %r{
(#{Twitter::TwitterText::Regex[:valid_url_preceding_chars]}) # $1 preceding chars
( # $2 URL
(https?:\/\/) # $3 Protocol (required)
(https?://) # $3 Protocol (required)
(#{Twitter::TwitterText::Regex[:valid_domain]}) # $4 Domain(s)
(?::(#{Twitter::TwitterText::Regex[:valid_port_number]}))? # $5 Port number (optional)
(/#{Twitter::TwitterText::Regex[:valid_url_path]}*)? # $6 URL Path and anchor

View file

@ -2,7 +2,7 @@
class FetchOEmbedService
ENDPOINT_CACHE_EXPIRES_IN = 24.hours.freeze
URL_REGEX = /(=(http[s]?(%3A|:)(\/\/|%2F%2F)))([^&]*)/i
URL_REGEX = %r{(=(https?(%3A|:)(//|%2F%2F)))([^&]*)}i
attr_reader :url, :options, :format, :endpoint_url

View file

@ -92,7 +92,7 @@ class SearchService < BaseService
end
def url_query?
@resolve && /\Ahttps?:\/\//.match?(@query)
@resolve && %r{\Ahttps?://}.match?(@query)
end
def url_resource_results