Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
MetaGer
Commits
63cd7ca5
Commit
63cd7ca5
authored
Nov 09, 2021
by
Dominik Hebeler
Browse files
each spam entry gets its own verification id
parent
fd9fa01b
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/HumanVerification.php
View file @
63cd7ca5
...
@@ -233,13 +233,13 @@ class HumanVerification extends Controller
...
@@ -233,13 +233,13 @@ class HumanVerification extends Controller
# Check for recent Spams
# Check for recent Spams
$eingabe
=
\
Request
::
input
(
'eingabe'
);
$eingabe
=
\
Request
::
input
(
'eingabe'
);
$spams
=
Redis
::
lrange
(
"spam"
,
0
,
-
1
);
$spams
=
Redis
::
lrange
(
"spam"
,
0
,
-
1
);
foreach
(
$spams
as
$spam
)
{
foreach
(
$spams
as
$index
=>
$spam
)
{
if
(
\
preg_match
(
$spam
,
$eingabe
))
{
if
(
\
preg_match
(
$spam
,
$eingabe
))
{
return
true
;
return
"999.999.999.999"
.
$index
;
}
}
}
}
return
false
;
return
null
;
}
}
public
function
botOverview
(
Request
$request
)
public
function
botOverview
(
Request
$request
)
...
...
app/Http/Middleware/HumanVerification.php
View file @
63cd7ca5
...
@@ -31,9 +31,11 @@ class HumanVerification
...
@@ -31,9 +31,11 @@ class HumanVerification
$ip
=
$request
->
ip
();
$ip
=
$request
->
ip
();
$id
=
""
;
$id
=
""
;
$uid
=
""
;
$uid
=
""
;
if
(
\
App\Http\Controllers\HumanVerification
::
couldBeSpammer
(
$ip
))
{
$id
=
hash
(
"sha1"
,
"999.999.999.999"
);
$spamID
=
\
App\Http\Controllers\HumanVerification
::
couldBeSpammer
(
$ip
);
$uid
=
hash
(
"sha1"
,
"999.999.999.999uid"
);
if
(
!
empty
(
$spamID
))
{
$id
=
hash
(
"sha1"
,
$spamID
);
$uid
=
hash
(
"sha1"
,
$spamID
.
"uid"
);
}
else
{
}
else
{
$id
=
hash
(
"sha1"
,
$ip
);
$id
=
hash
(
"sha1"
,
$ip
);
$uid
=
hash
(
"sha1"
,
$ip
.
$_SERVER
[
"AGENT"
]
.
"uid"
);
$uid
=
hash
(
"sha1"
,
$ip
.
$_SERVER
[
"AGENT"
]
.
"uid"
);
...
@@ -96,7 +98,6 @@ class HumanVerification
...
@@ -96,7 +98,6 @@ class HumanVerification
if
(
preg_match
(
"/http[s]
{
0,1}:\/\/metager\.de\/meta\/meta.ger3\?.*?eingabe=([\w\d]+\.){1,2
}
[\w\d]+/si"
,
$referer
)
===
1
)
{
if
(
preg_match
(
"/http[s]
{
0,1}:\/\/metager\.de\/meta\/meta.ger3\?.*?eingabe=([\w\d]+\.){1,2
}
[\w\d]+/si"
,
$referer
)
===
1
)
{
$refererLock
=
true
;
$refererLock
=
true
;
}
}
}
}
if
((
!
$alone
&&
$sum
>=
50
&&
!
$user
[
"whitelist"
])
||
$refererLock
)
{
if
((
!
$alone
&&
$sum
>=
50
&&
!
$user
[
"whitelist"
])
||
$refererLock
)
{
...
@@ -143,7 +144,6 @@ class HumanVerification
...
@@ -143,7 +144,6 @@ class HumanVerification
$request
->
request
->
add
([
'verification_id'
=>
$user
[
"uid"
],
'verification_count'
=>
$user
[
"unusedResultPages"
]]);
$request
->
request
->
add
([
'verification_id'
=>
$user
[
"uid"
],
'verification_count'
=>
$user
[
"unusedResultPages"
]]);
return
$next
(
$request
);
return
$next
(
$request
);
}
}
public
function
setUser
(
$prefix
,
$user
)
public
function
setUser
(
$prefix
,
$user
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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