bump-formula-pr: regex escape urls in replacements.
This commit is contained in:
parent
edd1c76d40
commit
98e48a9da7
@ -232,12 +232,12 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
replacement_pairs += formula_spec.mirrors.map do |mirror|
|
replacement_pairs += formula_spec.mirrors.map do |mirror|
|
||||||
[/ +mirror \"#{mirror}\"\n/m, ""]
|
[/ +mirror \"#{Regexp.escape(mirror)}\"\n/m, ""]
|
||||||
end
|
end
|
||||||
|
|
||||||
replacement_pairs += if new_url_hash
|
replacement_pairs += if new_url_hash
|
||||||
[
|
[
|
||||||
[formula_spec.url, new_url],
|
[/#{Regexp.escape(formula_spec.url)}/, new_url],
|
||||||
[old_hash, new_hash],
|
[old_hash, new_hash],
|
||||||
]
|
]
|
||||||
else
|
else
|
||||||
@ -250,7 +250,7 @@ module Homebrew
|
|||||||
backup_file = File.read(formula.path) unless ARGV.dry_run?
|
backup_file = File.read(formula.path) unless ARGV.dry_run?
|
||||||
|
|
||||||
if new_mirror
|
if new_mirror
|
||||||
replacement_pairs << [/^( +)(url \"#{new_url}\"\n)/m, "\\1\\2\\1mirror \"#{new_mirror}\"\n"]
|
replacement_pairs << [/^( +)(url \"#{Regexp.escape(new_url)}\"\n)/m, "\\1\\2\\1mirror \"#{new_mirror}\"\n"]
|
||||||
end
|
end
|
||||||
|
|
||||||
if forced_version && forced_version != "0"
|
if forced_version && forced_version != "0"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user