Skip to content

Commit

Permalink
Messenger: add validation to email and key fields in Mailing List sub…
Browse files Browse the repository at this point in the history
…scribe actions
  • Loading branch information
SKuipers committed Oct 30, 2024
1 parent 9f93f4d commit 003c1aa
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@
}

// Validate email and key
$email = $_POST['email'] ?? '';
$key = $_POST['key'] ?? '';
$email = filter_var(trim($_POST['email'] ?? ''), FILTER_SANITIZE_EMAIL);
$key = preg_replace('/[^a-zA-Z0-9]/', '', $_POST['key'] ?? '');
$keyCheck = $mailingListRecipientGateway->keyCheck($email, $key);

if ($keyCheck->rowCount() != 1) {
Expand All @@ -113,8 +113,8 @@
];

// Validate email and key
$email = $_GET['email'] ?? '';
$key = $_GET['key'] ?? '';
$email = filter_var(trim($_POST['email'] ?? ''), FILTER_SANITIZE_EMAIL);
$key = preg_replace('/[^a-zA-Z0-9]/', '', $_POST['key'] ?? '');
$keyCheck = $mailingListRecipientGateway->keyCheck($email, $key);

if ($keyCheck->rowCount() != 1) {
Expand Down

0 comments on commit 003c1aa

Please sign in to comment.