Skip to content

Commit

Permalink
Fix: If field is email type then we don't use urldecode
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtemAnoshin committed Jul 2, 2021
1 parent b7332d4 commit 248aff9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions cleantalk/inc/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -340,13 +340,15 @@ function apbct_get_fields_any($arr, $message=array(), $email = null, $nickname =
continue(2);
}
}unset($needle);


$value_for_email = trim($value);

// Decodes URL-encoded data to string.
$value = urldecode($value);
$value = urldecode(trim($value));

// Email
if (!$email && preg_match("/^\S+@\S+\.\S+$/", $value)){
$email = $value;
if (!$email && preg_match("/^\S+@\S+\.\S+$/", $value_for_email)){
$email = $value_for_email;

// Names
} elseif (
Expand Down

0 comments on commit 248aff9

Please sign in to comment.