diff --git a/cleantalk/inc/functions.php b/cleantalk/inc/functions.php index 5568aa9..0fd1185 100644 --- a/cleantalk/inc/functions.php +++ b/cleantalk/inc/functions.php @@ -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 (