fix broken commit dots
[phorkie.git] / src / phorkie / Repository / Commit.php
index ec4a04a7aed1bc3f83409277b862fc74a4a6c552..7c66673167e6080de54c412007731061efc468ef 100644 (file)
@@ -16,11 +16,21 @@ class Repository_Commit
 
     public function getIconUrl()
     {
+        if ($this->committerEmail == 'anonymous@phorkie') {
+            return '/phorkie/anonymous.png';
+        }
+
         //workaround for https://pear.php.net/bugs/bug.php?id=19384
         require_once 'PEAR/Services/Libravatar.php';
 
         $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 +44,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);