Skip to content
This repository was archived by the owner on Jan 15, 2022. It is now read-only.

fix/PLF-7973 : address of a site in .bzh is not accepted #449

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public class UIEditUserProfileForm extends UIForm {
"(((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\." + // IPAddress
"(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))|" + // IPAddress
"(?:(?:[-\\p{L}\\p{Digit}\\+\\$\\-\\*\\=]+\\.)+" +
"(?:com|org|net|edu|gov|mil|biz|info|mobi|name|aero|jobs|museum|travel|asia|cat|coop|int|pro|tel|xxx|[a-z]{2}))))|" + //Domain
"(?:com|org|net|edu|gov|mil|biz|bzh|info|mobi|name|aero|jobs|museum|travel|asia|cat|coop|int|pro|tel|xxx|[a-z]{2}))))|" + //Domain
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a lot more allowed domain extensions, we cannot list of all them. Instead we should remove this check and authorize any domain extension.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I solved the issue as it was described (allow access to bzh domain)
we cannot define a pattern for all domains extensions : to choices we have :remove this condition from pattern or add 3 characters length (in this case the user can introduce wrong domains)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot list all the authorized extensions, the list is too big (http://data.iana.org/TLD/tlds-alpha-by-domain.txt).

in this case the user can introduce wrong domains

Yes, but that's not a big deal. The user can also enter an url which does not exist, but we won't check it.

"(?:(?:(?:ht)tp(?:s?)\\:\\/\\/)(?:\\w+:\\w+@)?(?:[-\\p{L}\\p{Digit}\\+\\$\\-\\*\\=]+))" + // Protocol with hostname
")" +
"(?::[\\d]{1,5})?" + // port
Expand Down