bug-fix-patch

Soleved user profile pic issue and application URL in outgoing mail.
This commit is contained in:
Manish Verma
2016-10-17 17:47:10 +05:30
parent c43c02c46f
commit ec61ab6c7a
2 changed files with 17 additions and 2 deletions

View File

@@ -108,7 +108,7 @@ class PhpMailController extends Controller
} }
$system_link = $this->checkElement('system_link', $template_variables); $system_link = $this->checkElement('system_link', $template_variables);
if ($system_link === '') { if ($system_link === '') {
$system_link = url('/'); $system_link = \Config::get('app.url');
} }
$system_error = $this->checkElement('system_error', $template_variables); $system_error = $this->checkElement('system_error', $template_variables);
$agent_sign = $this->checkElement('agent_sign', $template_variables); $agent_sign = $this->checkElement('agent_sign', $template_variables);

View File

@@ -47,7 +47,8 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
if (!$pic) { if (!$pic) {
$pic = asset('uploads/profilepic/'.$value); $pic = asset('uploads/profilepic/'.$value);
} }
if (!$pic) {
if ($this->endsWith($pic, 'profilepic')) {
$pic = \Gravatar::src($this->attributes['email']); $pic = \Gravatar::src($this->attributes['email']);
} }
@@ -155,4 +156,18 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
return $this->user_name; 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);
}
} }