Skip to content

Commit 50644ff

Browse files
authored
Merge pull request #161 from rails/flavorjones-quash-uninit-ivar-warning
fix: avoid uninitialized ivar warning
2 parents 35937ce + 1d0947d commit 50644ff

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/rails/html/sanitizer.rb

+3-5
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,9 @@ def white_list_sanitizer # :nodoc:
2121
end
2222

2323
def html5_support?
24-
unless @html5_support_set
25-
@html5_support = Loofah.respond_to?(:html5_support?) && Loofah.html5_support?
26-
@html5_support_set = true
27-
end
28-
@html5_support
24+
return @html5_support if defined?(@html5_support)
25+
26+
@html5_support = Loofah.respond_to?(:html5_support?) && Loofah.html5_support?
2927
end
3028
end
3129

0 commit comments

Comments
 (0)