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

Wrong parsing result for TXT records containing semicolons #34

Open
wants to merge 56 commits into
base: master
Choose a base branch
from

Conversation

sergiomonteleone
Copy link

The function removeComments() in parseZoneFile.js will remove any string starting with semicolon (;). Unfortunately this causes issues with TXT records with semicolon characters in it, breaking parsing.
Replacing the regular expression in removeConnets() to something like this: /^;.*/gm solves the problem.

@elgs
Copy link
Owner

elgs commented Jul 17, 2019

Thank you so much for the PR and reminding me about the bug. I really appreciate. But the changes in this PR are too big for me to comprehend. I will try to fix the bug itself. Thank you!

@sergiomonteleone
Copy link
Author

Hi and thanks for your quick reply.
I'm sorry, I selected the wrong branch while submitting the PR and created this huge PR mess... my bad.

I just wanted to propose a simple modification, which changes the regular expression used in the function removeComments()

Here is a link to the patch I used in my working copy: https://gist.github.com/sergiomonteleone/a3fc44c2c6f8ca6b54f057ac3b3fa72e

Note: while this will prevent the parser from removing characters from the TXT records, it may fail to remove inline comments, as this regex will only select lines starting with semicolon. TLDR it may need more testing.

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.

8 participants