BUGFIX: proper regex escaping

This commit is contained in:
Régis Hanol 2014-06-11 16:37:26 +02:00
parent 2f23ee1830
commit 18489ba83a
1 changed files with 1 additions and 1 deletions

View File

@ -48,7 +48,7 @@ module Jobs
# have we successfully downloaded that file?
if downloaded_urls[src].present?
url = downloaded_urls[src]
escaped_src = src.gsub("?", "\\?").gsub(".", "\\.").gsub("+", "\\+")
escaped_src = Regexp.escape(src)
# there are 6 ways to insert an image in a post
# HTML tag - <img src="http://...">
raw.gsub!(/src=["']#{escaped_src}["']/i, "src='#{url}'")