@pablobm commented on this pull request.


> @@ -31,7 +31,7 @@ class SocialLink < ApplicationRecord
     :flickr => %r{\Ahttps?://(?:www\.)?flickr\.com/people/([a-zA-Z0-9@._-]+)},
     :github => %r{\Ahttps?://(?:www\.)?github\.com/([a-zA-Z0-9_-]+)},
     :gitlab => %r{\Ahttps?://(?:www\.)?gitlab\.com/([a-zA-Z0-9_-]+)},
-    :hdyc => %r{\Ahttps?://(?:www\.)?hdyc\.neis-one\.org/\?([a-zA-Z0-9_-]+)},
+    :hdyc => 
%r{\Ahttps?://(?:www\.)?hdyc\.neis-one\.org/\?([a-zA-Z0-9\s%20_-]+)},

Good question on what exact characters are allowed. HDYC references our display 
names, so anything valid on our website will be valid for HDYC. This seems to 
be the relevant declaration in our user validations:

https://github.com/openstreetmap/openstreetmap-website/blob/8738786e21b8c925e2d33078a6d76e5c9333db1c/app/models/user.rb#L106-L109

Which in turn uses a custom validator that excludes these characters:

https://github.com/openstreetmap/openstreetmap-website/blob/8738786e21b8c925e2d33078a6d76e5c9333db1c/app/validators/characters_validator.rb#L4-L5

So perhaps those constants should be used in the regexp? Similar to what the 
validator does when it goes `/[#{INVALID_CHARS}]/o.match?(value)`.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6468#discussion_r2459564920
You are receiving this because you are subscribed to this thread.

Message ID: 
<openstreetmap/openstreetmap-website/pull/6468/review/[email protected]>
_______________________________________________
rails-dev mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to