bug-fix-patch
Soleved user profile pic issue and application URL in outgoing mail.
This commit is contained in:
@@ -108,7 +108,7 @@ class PhpMailController extends Controller
|
||||
}
|
||||
$system_link = $this->checkElement('system_link', $template_variables);
|
||||
if ($system_link === '') {
|
||||
$system_link = url('/');
|
||||
$system_link = \Config::get('app.url');
|
||||
}
|
||||
$system_error = $this->checkElement('system_error', $template_variables);
|
||||
$agent_sign = $this->checkElement('agent_sign', $template_variables);
|
||||
|
17
app/User.php
17
app/User.php
@@ -47,7 +47,8 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
|
||||
if (!$pic) {
|
||||
$pic = asset('uploads/profilepic/'.$value);
|
||||
}
|
||||
if (!$pic) {
|
||||
|
||||
if ($this->endsWith($pic, 'profilepic')) {
|
||||
$pic = \Gravatar::src($this->attributes['email']);
|
||||
}
|
||||
|
||||
@@ -155,4 +156,18 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
|
||||
|
||||
return $this->user_name;
|
||||
}
|
||||
/**
|
||||
* @category function to check profile pic source srting ends with profilepic or not
|
||||
* @param string $haystack, $needle
|
||||
* @return boolean true/false
|
||||
*/
|
||||
function endsWith($haystack, $needle)
|
||||
{
|
||||
$length = strlen($needle);
|
||||
if ($length == 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return (substr($haystack, -$length) === $needle);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user