Skip to content

Allow users to input username and full url for LinkedIn and Twitter. See also #13571

Xavier Bick requested to merge zeiv/gitlab-ce:validate-twitter-linkedin into master

What does this MR do?

It allows users to input both their username only (e.g. 'testuser') as well as the full url for the twitter and linkedin profiles. It will validate input to ensure that it doesn't exceed a certain character limit (see #14406 (moved)) and that it doesn't contain special disallowed characters. If a user enters something that looks like a URL but doesn't match the social network's domain, it will also throw a validation error. See screenshots.

If there are special characters (fails format validation) Screen_Shot_2016-07-29_at_11.27.00_AM

If it is too long Screen_Shot_2016-07-29_at_11.27.25_AM

If the URL fails to be parsed Screen_Shot_2016-07-29_at_11.26.15_AM

Are there points in the code the reviewer needs to double check?

Not particularly, but as a first-time contributor you may want to look at my approach and where I put things. @rspeicher thoughts?

Why was this MR needed?

As of now, if a user inputs the full URL into either the Twitter or LinkedIn field on their profile, no validation will occur even though the correct input is the username only, resulting in links like https://www.linkedin.com/in/https://linkedin.com/in/testuser.

Screen_Shot_2016-07-29_at_11.54.35_AM

What are the relevant issue numbers?

Closes #13571 (closed), closes #14406 (moved), closes #17416 (closed)

Does this MR meet the acceptance criteria?

Merge request reports