Remove URL validation#1335
Merged
raklaptudirm merged 4 commits intoTheAlgorithms:masterfrom Jul 14, 2023
0-harshit-0:patch-1
Merged
Remove URL validation#1335raklaptudirm merged 4 commits intoTheAlgorithms:masterfrom 0-harshit-0:patch-1
raklaptudirm merged 4 commits intoTheAlgorithms:masterfrom
0-harshit-0:patch-1
Conversation
Used JS URL API to check if URL is valid. If valid it will return the url else false;
appgurueu
reviewed
Jul 5, 2023
Collaborator
appgurueu
left a comment
There was a problem hiding this comment.
I don't like this; it has about zero educational value (except for in a way "documenting" that the URL constructor throws an error on invalid URLs).
Effectively this is just a wrapper for the URL constructor, "coercing" errors into a boolean false. 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).
Contributor
Author
|
ok got it. |
Fixes: #1183
Contributor
Author
|
hello, I have removed the function. |
appgurueu
approved these changes
Jul 14, 2023
raklaptudirm
approved these changes
Jul 14, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.jsis allowed butuserprofile.js,Userprofile.js,user-Profile.js,userProfile.jsare notFixes: #{$ISSUE_NO}.