mirror of
https://github.com/Shopify/liquid.git
synced 2026-10-03 09:05:13 -07:00
Use early returns rather than large if in Variable#taint_check
This commit is contained in:
@@ -107,7 +107,9 @@ module Liquid
|
|||||||
end
|
end
|
||||||
|
|
||||||
def taint_check(context, obj)
|
def taint_check(context, obj)
|
||||||
if obj.tainted? && Template.taint_mode != :lax
|
return unless obj.tainted?
|
||||||
|
return if Template.taint_mode == :lax
|
||||||
|
|
||||||
@markup =~ QuotedFragment
|
@markup =~ QuotedFragment
|
||||||
name = Regexp.last_match(0)
|
name = Regexp.last_match(0)
|
||||||
|
|
||||||
@@ -123,5 +125,4 @@ module Liquid
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user