[icinga-checkins] icinga.org: icingaweb2/feature/announce-banner-11198: Announce: generate hash based on the message

git at icinga.org git at icinga.org
Thu Oct 27 13:39:23 CEST 2016


Module: icingaweb2
Branch: feature/announce-banner-11198
Commit: 096308d0257cfd41a0ff5bf473be05480ec49e19
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=096308d0257cfd41a0ff5bf473be05480ec49e19

Author: Alexander A. Klimov <alexander.klimov at icinga.com>
Date:   Thu Oct 27 13:39:16 2016 +0200

Announce: generate hash based on the message

---

 library/Icinga/Web/Announce.php |   12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/library/Icinga/Web/Announce.php b/library/Icinga/Web/Announce.php
index 8ce66a0..f5b52b9 100644
--- a/library/Icinga/Web/Announce.php
+++ b/library/Icinga/Web/Announce.php
@@ -31,7 +31,7 @@ class Announce
     protected $end;
 
     /**
-     * Hash of this Announce computed from its members
+     * Hash of the message
      *
      * @var string|null
      */
@@ -70,7 +70,6 @@ class Announce
     public function setAuthor($author)
     {
         $this->author = $author;
-        $this->hash = null;
         return $this;
     }
 
@@ -118,7 +117,6 @@ class Announce
     public function setStart($start)
     {
         $this->start = clone $start;
-        $this->hash = null;
         return $this;
     }
 
@@ -142,7 +140,6 @@ class Announce
     public function setEnd($end)
     {
         $this->end = clone $end;
-        $this->hash = null;
         return $this;
     }
 
@@ -154,12 +151,7 @@ class Announce
     public function getHash()
     {
         if ($this->hash === null) {
-            $this->hash = md5(serialize(array(
-                $this->author,
-                $this->message,
-                $this->start->getTimestamp(),
-                $this->end->getTimestamp()
-            )));
+            $this->hash = md5($this->message);
         }
         return $this->hash;
     }



More information about the icinga-checkins mailing list