Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eterfund-api-email
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
eterfund
eterfund-api-email
Commits
da3716b1
Commit
da3716b1
authored
Nov 30, 2017
by
Дмитрий Никулин
Committed by
Vitaly Lipatov
Nov 30, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
svcCheckEmail.php: normalize code style
parent
d24432c4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
svcCheckEmail.php
svcCheckEmail.php
+8
-8
No files found.
svcCheckEmail.php
View file @
da3716b1
...
...
@@ -9,8 +9,7 @@ header('Access-Control-Expose-Headers: DNT,X-CustomHeader,Keep-Alive,User-Agent,
error_reporting
(
0
);
function
typeddomain
(
$domain
)
{
function
typeddomain
(
$domain
)
{
// TODO: русские буквы в любом виде
// I know, yadex.ru and mail.com are exists, but we will ban it
// TODO: тут мы вполне можем предложить автоисправление
...
...
@@ -76,8 +75,10 @@ $site_domain = parse_url($http_referer, PHP_URL_HOST);
$ip_from
=
get_client_ip
();
// TODO: improve domain list? drop it?
if
(
mb_strlen
(
$email
,
'utf8'
)
>
5
&&
preg_match
(
'/^([^@\s]+)@(([a-zA-Z0-9\_\-]+\.)+([a-zA-Z]{2}|aero|arpa|asia|biz|cat|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|net|org|post|pro|tel|travel))$/'
,
$email
,
$matches
))
{
if
(
mb_strlen
(
$email
,
'utf8'
)
>
5
&&
preg_match
(
'/^([^@\s]+)@(([a-zA-Z0-9\_\-]+\.)+([a-zA-Z]{2}|aero|arpa|asia|biz|cat|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|net|org|post|pro|tel|travel))$/'
,
$email
,
$matches
)
)
{
$response
=
array
(
'email'
=>
$matches
[
0
],
...
...
@@ -89,10 +90,10 @@ if(mb_strlen($email, 'utf8') > 5 &&
'error'
=>
null
);
if
(
typeddomain
(
$matches
[
2
]))
{
if
(
typeddomain
(
$matches
[
2
]))
{
$response
[
'status'
]
=
false
;
$response
[
'error'
]
=
'typed_domain'
;
}
}
if
(
checkdnsrr
(
$matches
[
2
])
===
false
)
{
$response
[
'status'
]
=
false
;
...
...
@@ -115,8 +116,7 @@ if(typeddomain($matches[2])) {
PHP_EOL
;
file_put_contents
(
dirname
(
__FILE__
)
.
'/logs/'
.
$referer_host
.
'.'
.
(
$response
[
'status'
]
?
'ok'
:
'error'
)
.
'.log'
,
$data
,
FILE_APPEND
);
}
else
{
}
else
{
$response
=
array
(
'email'
=>
$email
,
'username'
=>
null
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment