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

Fix for error while reading UTF-8 encoded custom text file via the -f flag #402

Open
computerauditor opened this issue May 29, 2024 · 0 comments

Comments

@computerauditor
Copy link

I was unable to raise a pull request hence reporting this fix via issue!!! Tested while using python version 3.11.9
XSS-strike is having issues while reading custom xss payload file via -f flag , hence i modified the old "reader" function in the core/utils.py

Old code:

def reader(path):
    with open(path, 'r') as f:
        result = [line.rstrip(
                    '\n').encode('utf-8').decode('utf-8') for line in f]
    return result

Modified code:

def reader(path):
    with open(path, 'r', encoding='utf-8') as f:
        result = [line.rstrip('\n') for line in f]
    return result

Modify this at line 203 to 207 (reader function) in core/utils.py

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

No branches or pull requests

1 participant