[icinga-checkins] icinga.org: icingaweb2-module-director/master: Db: do not let the db adapter handle binary...

git at icinga.org git at icinga.org
Mon Oct 10 12:00:29 CEST 2016


Module: icingaweb2-module-director
Branch: master
Commit: 82c5b10eefd25415fa80de68ff0e7b4b7179b20c
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=82c5b10eefd25415fa80de68ff0e7b4b7179b20c

Author: Thomas Gelf <thomas at gelf.net>
Date:   Sun Oct  9 13:47:37 2016 +0000

Db: do not let the db adapter handle binary...

...data as this causes problems with Postgres and quoteBinary

---

 library/Director/Db.php |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/library/Director/Db.php b/library/Director/Db.php
index abfc7cf..0f4a87d 100644
--- a/library/Director/Db.php
+++ b/library/Director/Db.php
@@ -244,6 +244,8 @@ class Db extends DbConnection
 
     public function fetchActivityLogEntry($checksum)
     {
+        $db = $this->db();
+
         $sql = 'SELECT id, object_type, object_name, action_name,'
              . ' old_properties, new_properties, author, change_time,'
              . ' %s AS checksum, %s AS parent_checksum'
@@ -255,9 +257,8 @@ class Db extends DbConnection
             $this->dbHexFunc('parent_checksum')
         );
 
-        return $this->db()->fetchRow(
-            $sql,
-            $this->quoteBinary(Util::hex2binary($checksum))
+        return $db->fetchRow(
+            $db->quoteInto($sql, $this->quoteBinary(Util::hex2binary($checksum)))
         );
     }
 



More information about the icinga-checkins mailing list