X-Git-Url: https://git.cweiske.de/phorkie.git/blobdiff_plain/a4a47e2f9bd26259f0f6256a9652a39836c56a4d..52de444faa10f37c4174e9fe2c75e77484342549:/src/phorkie/Repository/Commit.php diff --git a/src/phorkie/Repository/Commit.php b/src/phorkie/Repository/Commit.php index ec4a04a..62f1d40 100644 --- a/src/phorkie/Repository/Commit.php +++ b/src/phorkie/Repository/Commit.php @@ -16,11 +16,18 @@ class Repository_Commit public function getIconUrl() { - //workaround for https://pear.php.net/bugs/bug.php?id=19384 - require_once 'PEAR/Services/Libravatar.php'; + if ($this->committerEmail == 'anonymous@phorkie') { + return '/phorkie/anonymous.png'; + } $s = new \Services_Libravatar(); - return $s->url('cweiske@cweiske.de'/*$this->committerEmail*/, array('s' => 32)); + return $s->url( + $this->committerEmail, + array( + 'size' => 32, + 'default' => Tools::fullUrl('/phorkie/anonymous.png') + ) + ); } /** @@ -34,8 +41,8 @@ class Repository_Commit $sum = $r + $g; if ($sum > 7) { $quot = ceil($sum / 7); - $r = int($r / $quot); - $g = int($g / $quot); + $r = intval($r / $quot); + $g = intval($g / $quot); } $string = str_repeat('g', $g) . str_repeat('r', $r) . str_repeat('n', 7 - $g - $r); @@ -63,4 +70,4 @@ class Repository_Commit } } -?> \ No newline at end of file +?>