From c382bb67e611f6ae9faef3a257564d1774e77e68 Mon Sep 17 00:00:00 2001 From: Mcat12 Date: Sat, 15 Dec 2018 20:34:36 -0500 Subject: [PATCH] Keep a trailing newline in the regex list when deleting an item Fixes #874 Signed-off-by: Mcat12 --- scripts/pi-hole/php/sub.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/pi-hole/php/sub.php b/scripts/pi-hole/php/sub.php index 62f1cfe1..b2dc0c51 100644 --- a/scripts/pi-hole/php/sub.php +++ b/scripts/pi-hole/php/sub.php @@ -36,7 +36,7 @@ switch($type) { $list = array_diff($list, array($_POST['domain'], "")); $list = implode("\n", $list); - if(file_put_contents($regexfile, $list) === FALSE) + if(file_put_contents($regexfile, $list."\n") === FALSE) { $err = error_get_last()["message"]; echo "Unable to remove regex \"".htmlspecialchars($_POST['domain'])."\" from ${regexfile}
Error message: $err";