audit: escape dep before regexp interpolation
This commit is contained in:
parent
3afa9c2ceb
commit
a3863394c0
@ -511,6 +511,7 @@ class FormulaAuditor
|
|||||||
end
|
end
|
||||||
|
|
||||||
def audit_conditional_dep(dep, condition, line)
|
def audit_conditional_dep(dep, condition, line)
|
||||||
|
dep = Regexp.escape(dep)
|
||||||
case condition
|
case condition
|
||||||
when /if build\.include\? ['"]with-#{dep}['"]$/, /if build\.with\? ['"]#{dep}['"]$/
|
when /if build\.include\? ['"]with-#{dep}['"]$/, /if build\.with\? ['"]#{dep}['"]$/
|
||||||
problem %{Replace #{line.inspect} with "depends_on #{quote_dep(dep)} => :optional"}
|
problem %{Replace #{line.inspect} with "depends_on #{quote_dep(dep)} => :optional"}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user