From c9f9ade96fef0e058704bd8583eb44dddff9965e Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Wed, 3 Jun 2020 17:47:35 +0100 Subject: [PATCH] Fix new rubocop warnings --- app/controllers/api/amf_controller.rb | 2 +- app/helpers/browse_tags_helper.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/api/amf_controller.rb b/app/controllers/api/amf_controller.rb index db8982d43..c05a13098 100644 --- a/app/controllers/api/amf_controller.rb +++ b/app/controllers/api/amf_controller.rb @@ -868,7 +868,7 @@ module Api # not just the id, hence this abstraction def getuser(token) - if token =~ /^(.+)\:(.+)$/ + if token =~ /^(.+):(.+)$/ User.authenticate(:username => Regexp.last_match(1), :password => Regexp.last_match(2)) else User.authenticate(:token => token) diff --git a/app/helpers/browse_tags_helper.rb b/app/helpers/browse_tags_helper.rb index 4f73eb9d7..fc25325a4 100644 --- a/app/helpers/browse_tags_helper.rb +++ b/app/helpers/browse_tags_helper.rb @@ -155,7 +155,7 @@ module BrowseTagsHelper # # Also accepting / as a visual separator although not given in RFC 3966, # because it is used as a visual separator in OSM data in some countries. - if value.match?(%r{^\s*\+[\d\s\(\)/\.-]{6,25}\s*(;\s*\+[\d\s\(\)/\.-]{6,25}\s*)*$}) + if value.match?(%r{^\s*\+[\d\s()/.-]{6,25}\s*(;\s*\+[\d\s()/.-]{6,25}\s*)*$}) return value.split(";").map do |phone_number| # for display, remove leading and trailing whitespace phone_number = phone_number.strip -- 2.39.5