From 3164b0a2c1e6b000d933263716f2e3f2ff1cca52 Mon Sep 17 00:00:00 2001 From: Nihad Abbasov Date: Tue, 25 Sep 2012 21:30:27 +0500 Subject: change ^ and $ anchors in regexp to \A and \z respectively http://guides.rubyonrails.org/security.html#regular-expressions --- actionpack/lib/action_view/helpers/asset_tag_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actionpack/lib/action_view/helpers/asset_tag_helper.rb b/actionpack/lib/action_view/helpers/asset_tag_helper.rb index 08efc98a50..27ba57ff58 100644 --- a/actionpack/lib/action_view/helpers/asset_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/asset_tag_helper.rb @@ -390,7 +390,7 @@ module ActionView 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 -- cgit v1.2.3