このコミットが含まれているのは:
@@ -138,7 +138,8 @@ class Post < ApplicationRecord
|
||||
end
|
||||
|
||||
def self.section_literal section
|
||||
"[#{ Post.ms_to_time(section.begin_ms) }-#{ section.end_ms ? Post.ms_to_time(section.end_ms) : '' }]"
|
||||
"[#{ Post.ms_to_time(section.begin_ms) }-"\
|
||||
"#{ section.end_ms ? Post.ms_to_time(section.end_ms) : '' }]"
|
||||
end
|
||||
|
||||
def self.ms_to_time ms
|
||||
@@ -323,7 +324,9 @@ class Post < ApplicationRecord
|
||||
end
|
||||
|
||||
def self.external_svg_reference?(attribute_name, attribute_value)
|
||||
return external_svg_url?(attribute_value) if ['href', 'xlink:href', 'src'].include?(attribute_name)
|
||||
if ['href', 'xlink:href', 'src'].include?(attribute_name)
|
||||
return external_svg_url?(attribute_value)
|
||||
end
|
||||
return style_contains_disallowed_urls?(attribute_value) if attribute_name == 'style'
|
||||
return svg_url_function_disallowed?(attribute_value) if attribute_value.match?(/url\s*\(/i)
|
||||
|
||||
@@ -344,7 +347,12 @@ class Post < ApplicationRecord
|
||||
|
||||
def self.svg_url_function_disallowed?(value)
|
||||
value.to_s.scan(/url\s*\(([^)]*)\)/i).flatten.any? do |entry|
|
||||
reference = entry.to_s.strip.delete_prefix("'").delete_prefix('"').delete_suffix("'").delete_suffix('"')
|
||||
reference =
|
||||
entry.to_s.strip
|
||||
.delete_prefix("'")
|
||||
.delete_prefix('"')
|
||||
.delete_suffix("'")
|
||||
.delete_suffix('"')
|
||||
reference.present? && !(reference.start_with?('#'))
|
||||
end
|
||||
end
|
||||
@@ -433,7 +441,12 @@ class Post < ApplicationRecord
|
||||
|
||||
match =
|
||||
value.match(
|
||||
/\A(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d+))?)?(Z|[+-]\d{2}:?\d{2})?\z/)
|
||||
/
|
||||
\A(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})
|
||||
(?::(\d{2})(?:\.(\d+))?)?
|
||||
(Z|[+-]\d{2}:?\d{2})?
|
||||
\z
|
||||
/x)
|
||||
return nil if match.nil?
|
||||
|
||||
year = match[1].to_i
|
||||
|
||||
新しい課題から参照
ユーザをブロックする