profile-pic

Updated profile pic for hidden backdoor scripts
This commit is contained in:
Manish Verma
2017-05-08 14:24:56 +05:30
parent 0a8118ac46
commit f06f07c10e

View File

@@ -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;
}