mirror of
https://github.com/pi-hole/web.git
synced 2026-04-24 18:59:48 +01:00
Directly manipulate regex.list from PHP to avoid detour over bash. This needs read/write permissions of the PHP user on "/etc/pihole/regex.list" !
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -11,6 +11,7 @@ $ERRORLOG = getenv('PHP_ERROR_LOG');
|
||||
if (empty($ERRORLOG)) {
|
||||
$ERRORLOG = '/var/log/lighttpd/error.log';
|
||||
}
|
||||
$regexfile = "/etc/pihole/regex.list";
|
||||
|
||||
function pi_log($message) {
|
||||
error_log(date('Y-m-d H:i:s') . ': ' . $message . "\n", 3, $GLOBALS['ERRORLOG']);
|
||||
@@ -133,6 +134,14 @@ function list_verify($type) {
|
||||
{
|
||||
log_and_die("Not allowed!");
|
||||
}
|
||||
check_domain();
|
||||
|
||||
// Don't check if the added item is a
|
||||
// valid domain for regex expressions
|
||||
// Regex filters are validated by FTL
|
||||
// on import and skipped if invalid
|
||||
if($_POST['list'] !== "wild")
|
||||
{
|
||||
check_domain();
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user