mirror of
https://github.com/pi-hole/web.git
synced 2026-04-24 02:39:25 +01:00
Directly write imported regex file to disk instead of useing bash callbacks
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -45,10 +45,10 @@ if(!function_exists('hash_equals')) {
|
||||
}
|
||||
}
|
||||
|
||||
function add_regex($regex)
|
||||
function add_regex($regex, $mode=FILE_APPEND, $append="\n")
|
||||
{
|
||||
global $regexfile;
|
||||
if(file_put_contents($regexfile, "\n".$regex, FILE_APPEND) === FALSE)
|
||||
if(file_put_contents($regexfile, $append.$regex, $mode) === FALSE)
|
||||
{
|
||||
$err = error_get_last()["message"];
|
||||
echo "Unable to add regex \"".htmlspecialchars($regex)."\" to ${regexfile}<br>Error message: $err";
|
||||
|
||||
Reference in New Issue
Block a user