fix avatar for deleted user and campaign tracker 1px
This commit is contained in:
@@ -77,7 +77,15 @@ class Avatar extends Image
|
||||
|
||||
$user = $this->getEntityManager()->getEntity('User', $userId);
|
||||
if (!$user) {
|
||||
throw new NotFound();
|
||||
header('Content-Type: image/png');
|
||||
$img = imagecreatetruecolor(14, 14);
|
||||
imagesavealpha($img, true);
|
||||
$color = imagecolorallocatealpha($img, 127, 127, 127, 127);
|
||||
imagefill($img, 0, 0, $color);
|
||||
imagepng($img);
|
||||
imagecolordeallocate($img, $color);
|
||||
imagedestroy($img);
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($_GET['attachmentId'])) {
|
||||
|
||||
@@ -86,11 +86,11 @@ class CampaignTrackOpened extends \Espo\Core\EntryPoints\Base
|
||||
|
||||
$img = imagecreatetruecolor(1, 1);
|
||||
imagesavealpha($img, true);
|
||||
$color = imagecolorallocatealpha($img, 0, 0, 0, 127);
|
||||
$color = imagecolorallocatealpha($img, 127, 127, 127, 127);
|
||||
imagefill($img, 0, 0, $color);
|
||||
|
||||
imagepng($img);
|
||||
imagecolordeallocate($color);
|
||||
imagecolordeallocate($img, $color);
|
||||
imagedestroy($img);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user