replace newlines in userinput newlistdestination to avoid error

This commit is contained in:
Paul 2021-09-21 17:20:44 +02:00
parent e04470b95f
commit a04893aed9
1 changed files with 3 additions and 1 deletions

View File

@ -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]);