Problem with Beta 5.0:
I managed to get a "ghost" regex blacklist entry I can't seem to remove through normal means. I tried adding ^(.+\.)?amp\..+\.com$ with comment "Google AMP" using the web interface, and it added this to my list:
Clicking the delete button appeared to delete the entry and showed a green success message. However, upon reloading the page the entry is still there.
I also tried removing it through the command line:
$ pihole --regex -d '()'
[i] () does not exist in regex blacklist, no need to remove!
$ pihole --regex -d "^(.+\.)?amp\..+\.com$"
[i] ^(.+\.)?amp\..+\.com$ does not exist in regex blacklist, no need to remove!
List of regex blacklist entries (most have been redacted - 25 is the broken entry):
$ pihole --regex -l
Displaying regex blacklist:
1: (^|\.)datasharing\.spotify\.com$ (enabled, last modified Fri, 31 Jan 2020 18:53:01 -0500)
...
25: (enabled, last modified Wed, 05 Feb 2020 06:46:10 -0500)
EDIT: I found that I was able to successfully remove it through the remove button in the Group Management > Domains page in the web interface, though there's certainly still a bug here.
EDIT 2: Seems like I can add ^(.+\.)?amp\..+\.com$ with the command line:
$ pihole --regex '^(.+\.)?amp\..+\.com$'
[i] Adding ^(.+\.)?amp\..+\.com$ to the regex blacklist...
[✓] Reloading DNS lists
So I suppose this is probably a problem with the web interface.
Unfortunately, I'm not in the position to do any test myself until at least Tuesday.
@DanSchaper@PromoFaux@jfb Given that the new group management pages can do more than the legacy pages, shall we remove them in favor of the former? Or do you think this is too intrusive and we should rather fix this bug?
If we get rid of the legacy pages, we should clearly rearrange the navigation menu to avoid hiding these pages.
I should note that while I was able to remove the bugged () entry through the group management page, attempting to add ^(.+\.)?amp\..+\.com$ as a regex blacklist entry incorrectly creates a () entry through BOTH the group management and legacy page. So, simply getting rid of the legacy pages wouldn't completely fix this bug.
The domain you attempted to add was ^(.+.)?amp…+.com$. The domain I mentioned was ^(.+\.)?amp\..+\.com$. Like you, I am unable to reproduce the issue with the former, but am still able to reproduce the issue with mine using an up-to-date installation.
And yes, only the () entry appeared when I attempted to add the latter.
I think i figured out where the problem is, i modified the /var/www/html/admin/scripts/pi-hole/php/group.php and removed the idn_to_ascii function and it can now insert it just fine in the group management -> domains.
// under add_domain
From - $domain = idn_to_ascii($_POST['domain']);
To - $domain = $_POST['domain'];
something wrong with idn_to_ascii it returns false.
maybe idn_to_ascii is not suitable for regex?
I don't think you're going crazy, you probably copied it from @Michail_Giannopoulos's comment.
I can now successfully add ^(.+\.)?amp\..+\.com$ as a regex from the old Blacklist and Whitelist pages. However, on the Group Management > Domains page, typing that domain and choosing type Regex Blacklist/Whitelist gives an error, and nothing is added:
Error, something went wrong!
While executing: NOT NULL constraint failed: domainlist.domain
This seems to happen with any regex input on the Group Management page, not just ^(.+\.)?amp\..+\.com$.
Oh yes, sorry. When moving around the domain encoding code, I forgot to add a general rule that applies also to the regex domains. This is now fixed, please update.