mirror of
https://github.com/pi-hole/web.git
synced 2026-04-25 03:10:18 +01:00
Extract domain in addition request for all domain types, not just the exact ones.
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -372,13 +372,14 @@ if ($_POST['action'] == 'get_groups') {
|
||||
}
|
||||
|
||||
$type = intval($_POST['type']);
|
||||
$domain = $_POST['domain'];
|
||||
|
||||
if ($type === ListType::whitelist || $type === ListType::blacklist) {
|
||||
// Convert domain name to IDNA ASCII form for international domains
|
||||
$domain = idn_to_ascii($_POST['domain']);
|
||||
// Convert domain name to IDNA ASCII form for international
|
||||
// domains and convert the domain to lower case
|
||||
$domain = strtolower(idn_to_ascii($domain));
|
||||
|
||||
// If adding to the exact lists, we convert the domain lower case and check whether it is valid
|
||||
$domain = strtolower($domain);
|
||||
// Check validity of domain
|
||||
if(filter_var($domain, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME) === false)
|
||||
{
|
||||
throw new Exception('Domain ' . htmlentities(utf8_encode($domain)) . 'is not a valid domain.');
|
||||
|
||||
Reference in New Issue
Block a user