aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-05-05 17:01:13 +0200
committerJoas Schilling <nickvergessen@gmx.de>2014-05-29 02:14:42 +0200
commit427d70d1387090befbff4b0d2f24efd84cfc0392 (patch)
tree9a09235ae111a1b54fe4216b0116d8fe2461606b /phpBB
parent0108e19d2119b312d48227bca9ae23d6dd8189f2 (diff)
downloadforums-427d70d1387090befbff4b0d2f24efd84cfc0392.tar
forums-427d70d1387090befbff4b0d2f24efd84cfc0392.tar.gz
forums-427d70d1387090befbff4b0d2f24efd84cfc0392.tar.bz2
forums-427d70d1387090befbff4b0d2f24efd84cfc0392.tar.xz
forums-427d70d1387090befbff4b0d2f24efd84cfc0392.zip
[ticket/10073] Use phpbb_validate_email to verify email address
PHPBB3-10073
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/phpbb/message/admin_form.php22
1 files changed, 20 insertions, 2 deletions
diff --git a/phpBB/phpbb/message/admin_form.php b/phpBB/phpbb/message/admin_form.php
index 7bab96eec2..aa185da740 100644
--- a/phpBB/phpbb/message/admin_form.php
+++ b/phpBB/phpbb/message/admin_form.php
@@ -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'))
+ {
+ 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['EMPTY_SENDER_EMAIL'];
+ $this->errors[] = $this->user->lang[$error];
}
$this->message->set_sender($this->user->ip, $this->sender_name, $this->sender_address, $this->user->lang_name);