Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FangURL #654

Closed
wants to merge 3 commits into from
Closed

Add FangURL #654

wants to merge 3 commits into from

Conversation

arnydo
Copy link
Contributor

@arnydo arnydo commented Oct 2, 2019

FangURL takes a "defanged" URL that was previously rendered useless and allows it to be functional again. In cases where a batch of "defanged" urls have been obtained this will allow for a quick process to return them to their original format. Often necessary when injecting into other systems.

@hkzck
Copy link

hkzck commented Mar 1, 2024

Why is there no merge code here? I feel this feature is still very necessary. Looking forward to hearing from you

@arnydo
Copy link
Contributor Author

arnydo commented Mar 1, 2024

I don't know why this hasn't been merged... It would sure be helpful...

@a3957273
Copy link
Member

Apologies that this didn't get merged in sooner! I've only recently taken on this project and it's definitely going to take me ages to get through all the pull requests.

In the mean time, #1591 has made essentially an equivalent pull request with a shockingly identical implementation. I'm going to merge that in, but I'm going to credit both of you for coming up with a similar solution.

@a3957273 a3957273 closed this Mar 29, 2024
function fangURL(url, dots, http, slashes) {
if (dots) url = url.replace(/\[\.\]/g, ".");
if (http) url = url.replace(/hxxp/g, "http");
if (slashes) url = url.replace(/[://]/g, "://");
Copy link
Member

Choose a reason for hiding this comment

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

FYI there's a bug here, the [] are being treated as regular expression special characters. You should escape them for searches like this.

@a3957273
Copy link
Member

In the end this PR actually came out on top, as the other PR had some fundamental issues with it. Made the above bug fix here and merged: #1761

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants