X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/05e212027339733cf39aa9b7536c3f5f69ba0962..f0cac0fcc37506ad981cdc3fd6607d5a2c3e4ca0:/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