Skip to content

Commit

Permalink
Bugfix: Visitor history avatar not displayed when visitor_avatar_id n…
Browse files Browse the repository at this point in the history
…ot set (Open-Web-Analytics#458)

* Bugfix: Visitor history avatar not displayed when visitor_avatar_id not set. Always respond with 404, because url always gets '(not set)' prepended.

* Revert "Bugfix: Visitor history avatar not displayed when visitor_avatar_id not set. Always respond with 404, because url always gets '(not set)' prepended."

This reverts commit b6bd0e5

* Bugfix: Visitor history avatar not displayed when visitor_avatar_id not set. Always respond with 404, because url always gets '(not set)' prepended.
  • Loading branch information
Maaiins authored Mar 7, 2020
1 parent 45f47df commit 766f68a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modules/base/templates/report_visitor.tpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div>
<div style="display: table-cell; vertical-align: middle">
<span><img class="owa_avatar" style="vertical-align:middle;" src="<?php echo $this->getAvatarImage( $this->out($this->get('visitor_avatar_id') ) );?>" /></span>
<span><img class="owa_avatar" style="vertical-align:middle;" src="<?php $this->out( $this->getAvatarImage( $this->get('visitor_avatar_id') ) );?>" /></span>
<span class="inline_h2"><?php $this->out( $visitor_label );?></span>
</div>
<BR>
Expand Down
2 changes: 1 addition & 1 deletion owa_template.php
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ function formatNumber($num, $decimal_places) {

function getAvatarImage($email) {

if (false != $email) {
if (false != $email && $email !== '(not set)') {
$url = sprintf("https://www.gravatar.com/avatar/%s?s=30", md5($email));
} else {
$url = $this->makeImageLink('base/i/default_user_50x50.png');
Expand Down

0 comments on commit 766f68a

Please sign in to comment.