Remove @regexp_timeout_reported from AutoLinkScrubber

No longer needed since the scrubber is not memoized across calls and the
text node length guard prevents the performance issue.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Mike Dalessio
2026-03-20 19:53:02 -04:00
parent 87c659cd67
commit 8c3461a1d6
+1 -3
View File
@@ -22,13 +22,12 @@ class AutoLinkScrubber < Loofah::Scrubber
def initialize
@direction = :top_down
@regexp_timeout_reported = false
end
def scrub(node)
return Loofah::Scrubber::STOP if EXCLUDED_ELEMENTS.include?(node.name)
if node.text? && !@regexp_timeout_reported
if node.text?
replacement = autolink_text_node(node)
node.replace(replacement) if replacement
end
@@ -78,7 +77,6 @@ class AutoLinkScrubber < Loofah::Scrubber
links
rescue Regexp::TimeoutError => error
Sentry.capture_exception error if Fizzy.saas?
@regexp_timeout_reported = true
[]
end