X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/05e212027339733cf39aa9b7536c3f5f69ba0962..c08f9a2f0343a4c9ca2543737c8cb8747d816e02:/vendor/plugins/http_accept_language/lib/http_accept_language.rb diff --git a/vendor/plugins/http_accept_language/lib/http_accept_language.rb b/vendor/plugins/http_accept_language/lib/http_accept_language.rb index 1bedd6c74..1266a3e64 100644 --- a/vendor/plugins/http_accept_language/lib/http_accept_language.rb +++ b/vendor/plugins/http_accept_language/lib/http_accept_language.rb @@ -49,7 +49,7 @@ module HttpAcceptLanguage def compatible_language_from(array) user_preferred_languages.map do |x| array.find do |y| - y.to_s =~ /^#{x.to_s}(-|$)/ + y.to_s =~ /^#{Regexp.escape(x.to_s)}(-|$)/ end end.compact.first end