From a04893aed9495372159f56919c71584bec5f8d7c Mon Sep 17 00:00:00 2001 From: humorhenker Date: Tue, 21 Sep 2021 17:20:44 +0200 Subject: [PATCH] replace newlines in userinput newlistdestination to avoid error --- public/bin/editlist.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/bin/editlist.php b/public/bin/editlist.php index e9c080c..914dfdf 100644 --- a/public/bin/editlist.php +++ b/public/bin/editlist.php @@ -70,7 +70,9 @@ if ($_SESSION['log'] == 1) { $oldlistdestinations[3][] = $row['destination_username'] . '@' . $row['destination_domain']; } $newlistdestinations = array(array(),array(),array()); - foreach (explode(' ', $_POST['newlistdestinations']) as $newlistdestination) { + // replace newlines in userinput newlistdestination to avoid error + $postnewlistdestinations = preg_replace('~\R~u', " ", $_POST['newlistdestinations']); + foreach (explode(' ', $postnewlistdestinations) as $newlistdestination) { $newlistdestinationex = explode('@', $newlistdestination); array_push($newlistdestinations[0], $newlistdestinationex[0]); array_push($newlistdestinations[1], $newlistdestinationex[1]);