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

Use simpler regex format for wildcards #799

Merged
merged 2 commits into from
Aug 1, 2018

Conversation

AzureMarker
Copy link
Contributor

@AzureMarker AzureMarker commented Aug 1, 2018

By submitting this pull request, I confirm the following:

  • I have read and understood the contributors guide, as well as this entire template.
  • I have made only one major change in my proposed changes.
  • I have commented my proposed changes within the code.
  • I have tested my proposed changes.
  • I am willing to help maintain this change if there are issues with it later.
  • I give this submission freely and claim no ownership.
  • It is compatible with the EUPL 1.2 license
  • I have squashed any insignificant commits. (git rebase)
  • I have Signed Off all commits. (git commit --signoff)

What does this PR aim to accomplish?:
Use a simpler wildcard regex format proposed here

How does this PR accomplish the above?:
Use \.?domain\.com$ instead of ((^)|(\.))domain\.com$

What documentation changes (if any) are needed to support this PR?:
None

See also pi-hole/pi-hole#2318

Use `\.?domain\.com$` instead of `((^)|(\.))domain\.com$`

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
@AzureMarker AzureMarker added this to the v4.0 milestone Aug 1, 2018
@AzureMarker AzureMarker requested a review from a team August 1, 2018 01:40
@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/sugestings-about-name-giving-lists/11216/4

The `\.?` is too permissive, letting in anything that ends in the domain

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
Copy link
Member

@DL6ER DL6ER left a comment

Choose a reason for hiding this comment

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

This regex is equivalent. Although it should be identical, the number of parenthesized subexpressions is reduced (one instead of three) so it might actually slightly improve the speed of the regex validator.

DL6ER
DL6ER approved these changes Aug 1, 2018
@dschaper dschaper merged commit 210160c into release/v4.0 Aug 1, 2018
@dschaper dschaper deleted the tweak/wildcard-regex-format branch August 1, 2018 08:01
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.

4 participants