mirror of
https://github.com/pi-hole/web.git
synced 2026-04-27 20:24:10 +01:00
Merge pull request #1683 from mdujava/basic_auth
Url of adlist can contain userinfo (basicauth)
This commit is contained in:
@@ -937,7 +937,11 @@ if ($_POST['action'] == 'get_groups') {
|
||||
continue;
|
||||
}
|
||||
|
||||
if(preg_match("/[^a-zA-Z0-9:\/?&%=~._()-;]/", $address) !== 0) {
|
||||
// this will remove first @ that is after schema and before domain
|
||||
// $1 is optional schema, $2 is userinfo
|
||||
$check_address = preg_replace("|([^:/]*://)?([^/]+)@|", "$1$2", $address, 1);
|
||||
|
||||
if(preg_match("/[^a-zA-Z0-9:\/?&%=~._()-;]/", $check_address) !== 0) {
|
||||
throw new Exception('<strong>Invalid adlist URL ' . htmlentities($address) . '</strong><br>'.
|
||||
'Added ' . $added . " out of ". $total . " adlists");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user