Skip to content

Commit

Permalink
fix form raummiete
Browse files Browse the repository at this point in the history
  • Loading branch information
han16nah committed Jul 9, 2024
1 parent 5d34725 commit ed6f4b6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions content/pages/events/mieten/send.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,19 @@ function check_for_spam($logs, $ip_address) {
$logs = update_logs($logs, $ip_address);
write_logs($logs, $log_file);

// spam protection
$spam = check_for_spam($logs, $ip_address);

if (! $spam ) {
$data = ["email" => $form->post('email','Email','valid_email')];
foreach ($fields as $field) {
$_dat = $form->post($field);
// just a sanity check, shouldnt happen but if somebody does shenanigans this will cut it down
if (mb_strlen($_dat, 'utf8') > 2500) {
$_dat = mb_substr($_dat, 0, 2500, 'utf8');
}
$data[$field] = $_dat;
}

$applicant = array($data["email"], $data['full_name']);

Expand Down

0 comments on commit ed6f4b6

Please sign in to comment.