mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-06-24 05:51:48 +02:00
Fix possible sql injection in whereRaw query
This commit is contained in:
parent
d349f09ed4
commit
3d59b8b3c9
@ -27,7 +27,7 @@ class CaseInsensitiveEmailExists implements Rule
|
|||||||
public function passes($attribute, $value)
|
public function passes($attribute, $value)
|
||||||
{
|
{
|
||||||
$user = DB::table('users')
|
$user = DB::table('users')
|
||||||
->whereRaw('email = \'' . strtolower($value) . '\'' . ('sqlite' === config('database.default') ? ' COLLATE NOCASE' : ''))
|
->whereRaw('email = ?' . ('sqlite' === config('database.default') ? ' COLLATE NOCASE' : ''), [strtolower($value)])
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
return ! $user ? false : true;
|
return ! $user ? false : true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user