# 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)
#
# 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