1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-02-24 12:03:21 +01:00

[ticket/10073] Use phpbb_validate_email to verify email address

PHPBB3-10073
This commit is contained in:
Joas Schilling 2014-05-05 17:01:13 +02:00
parent 0108e19d21
commit 427d70d138

View File

@ -101,9 +101,27 @@ class admin_form extends form
{
$this->errors[] = $this->user->lang['EMPTY_SENDER_NAME'];
}
if (!$this->sender_address || !preg_match('/^' . get_preg_expression('email') . '$/i', $this->sender_address))
if (!function_exists('validate_data'))
{
$this->errors[] = $this->user->lang['EMPTY_SENDER_EMAIL'];
require($this->phpbb_root_path . 'includes/functions_user.' . $this->phpEx);
}
$validate_array = validate_data(
array(
'email' => $this->sender_address,
),
array(
'email' => array(
array('string', false, 6, 60),
array('email'),
),
)
);
foreach ($validate_array as $error)
{
$this->errors[] = $this->user->lang[$error];
}
$this->message->set_sender($this->user->ip, $this->sender_name, $this->sender_address, $this->user->lang_name);