提交 3164b0a2 编写于 作者: N Nihad Abbasov

change ^ and $ anchors in regexp to \A and \z respectively

http://guides.rubyonrails.org/security.html#regular-expressions
上级 2b9bce88
......@@ -390,7 +390,7 @@ def image_tag(source, options={})
end
if size = options.delete(:size)
options[:width], options[:height] = size.split("x") if size =~ %r{^\d+x\d+$}
options[:width], options[:height] = size.split("x") if size =~ %r{\A\d+x\d+\z}
options[:width] = options[:height] = size if size =~ %r{\A\d+\z}
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册