From f06f07c10e5283940fe2f0e59c9e785b01c61c21 Mon Sep 17 00:00:00 2001 From: Manish Verma Date: Mon, 8 May 2017 14:24:56 +0530 Subject: [PATCH] profile-pic Updated profile pic for hidden backdoor scripts --- app/User.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/User.php b/app/User.php index a746bd1c7..d6d573d21 100644 --- a/app/User.php +++ b/app/User.php @@ -44,13 +44,18 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon if ($info) { $pic = $this->checkArray('avatar', $info); } - if (!$pic) { - $pic = asset('uploads/profilepic/'.$value); + if (!$pic && $value) { + $pic = ""; + $file = public_path('uploads/profilepic/' . $value); + if ($file) { + $type = pathinfo($file, PATHINFO_EXTENSION); + $data = file_get_contents($file); + $pic = 'data:image/' . $type . ';base64,' . base64_encode($data); + } } if (!$value) { $pic = \Gravatar::src($this->attributes['email']); } - return $pic; }