Keep a trailing newline in the regex list when deleting an item

Fixes #874

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
This commit is contained in:
Mcat12
2018-12-15 20:34:36 -05:00
parent 5ec769d9d8
commit c382bb67e6

View File

@@ -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}<br>Error message: $err";