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

Do not apply IDNA conversion to RegEx domains #2336

Merged
merged 1 commit into from
Sep 8, 2022
Merged

Do not apply IDNA conversion to RegEx domains #2336

merged 1 commit into from
Sep 8, 2022

Conversation

yubiuser
Copy link
Member

@yubiuser yubiuser commented Sep 7, 2022

What does this PR aim to accomplish?:

Fixes #2335.

When adding domains to the database we do a convertUnicodeToIDNA before. However, this is not needed for RegEx and can instead lead to side effects seen in the linked issue. This PR moves the conversion into the already existing if clause that only triggers if no RegEx is added.

P.S. The used PHP function idn_to_ascii does not convert "invalid" domains but instead returns false which will add an empty domain to the database


By submitting this pull request, I confirm the following:

  1. I have read and understood the contributors guide, as well as this entire template. I understand which branch to base my commits and Pull Requests against.
  2. I have commented my proposed changes within the code and I have tested my changes.
  3. I am willing to help maintain this change if there are issues with it later.
  4. It is compatible with the EUPL 1.2 license
  5. I have squashed any insignificant commits. (git rebase)

  • I have read the above and my PR is ready for review. Check this box to confirm

@yubiuser yubiuser added the PR: Approval Required Open Pull Request, needs approval label Sep 7, 2022
@yubiuser yubiuser requested a review from a team September 7, 2022 19:46
@yubiuser yubiuser linked an issue Sep 7, 2022 that may be closed by this pull request
Signed-off-by: Christian König <ckoenig@posteo.de>
@yubiuser
Copy link
Member Author

yubiuser commented Sep 7, 2022

Confirmed working in the linked issue report.

@DL6ER DL6ER merged commit c958cc8 into devel Sep 8, 2022
@DL6ER DL6ER deleted the fix/IDNA branch September 8, 2022 05:43
@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/regex-block-slipping-through-the-cracks-youtube/57601/8

@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/domain-address-is-not-allowed-on-blacklist/57859/2

@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/pi-hole-ftl-v5-18-web-v5-15-and-core-v5-12-1-released/57894/1

@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/blocking-all-tlds-of-a-domain/58025/2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Approval Required Open Pull Request, needs approval
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to add regex to blacklist all domains
3 participants