Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.7k
Remove URL validation#1335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Used JS URL API to check if URL is valid. If valid it will return the url else false;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I don't like this; it has about zero educational value (except for in a way "documenting" that theURL
constructor throws an error on invalid URLs).
Effectively this is just a wrapper for theURL
constructor, "coercing" errors into a booleanfalse
. This adds no real value over the URL constructor and removes educational value by removing the (arguably broken) RegEx.
I see the following two options:
- Remove
ValidateURL
, since it is obviously broken. - Fix
ValidateURL
, reimplementing JavaScript builtin functionality (to demonstrate how it might be implemented).
ok got it. |
hello, I have removed the function. |
Fixes:#1183
Used JS URL API to check if URL is valid. If valid it will return the url else false;
Describe your change:
Checklist:
Example:
UserProfile.js
is allowed butuserprofile.js
,Userprofile.js
,user-Profile.js
,userProfile.js
are notFixes: #{$ISSUE_NO}
.