@@ -50,11 +50,11 @@ public function fetchData()
5050 if ($ this ->getDb ()->getAdapter () instanceof Sql \Adapter \Pgsql) {
5151 $ targets
5252 ->withColumns ([
53- 'cert_fingerprint ' => new Sql \Expression (' ENCODE(%s, \ 'hex \' ) ' , [
53+ 'cert_fingerprint ' => new Sql \Expression (" ENCODE(%s, 'hex') " , [
5454 'chain.certificate.fingerprint '
5555 ]),
5656 'cert_dn ' => new Sql \Expression (
57- ' ARRAY_TO_STRING(ARRAY_AGG(CONCAT(%s, \' = \ ', %s)), \' , \' ) ' ,
57+ " ARRAY_TO_STRING(ARRAY_AGG(CONCAT(%s, '= ', %s)), ',') " ,
5858 [
5959 'chain.certificate.dn.key ' ,
6060 'chain.certificate.dn.value '
@@ -65,13 +65,13 @@ public function fetchData()
6565 ->groupBy (['target_chain_certificate.id ' , 'target_chain_certificate_issuer_certificate.id ' ]);
6666
6767 $ certAltName ->columns ([
68- new Sql \Expression (' ARRAY_TO_STRING(ARRAY_AGG(CONCAT(%s, \' : \ ', %s)), \' , \' ) ' , ['type ' , 'value ' ])
68+ new Sql \Expression (" ARRAY_TO_STRING(ARRAY_AGG(CONCAT(%s, ': ', %s)), ',') " , ['type ' , 'value ' ])
6969 ]);
7070 } else {
7171 $ targets ->withColumns ([
7272 'cert_fingerprint ' => new Sql \Expression ('HEX(%s) ' , ['chain.certificate.fingerprint ' ]),
7373 'cert_dn ' => new Sql \Expression (
74- ' GROUP_CONCAT(CONCAT(%s, \' = \ ', %s) SEPARATOR \' , \' ) ' ,
74+ " GROUP_CONCAT(CONCAT(%s, '= ', %s) SEPARATOR ',') " ,
7575 [
7676 'chain.certificate.dn.key ' ,
7777 'chain.certificate.dn.value '
@@ -80,7 +80,7 @@ public function fetchData()
8080 ]);
8181
8282 $ certAltName ->columns ([
83- new Sql \Expression (' GROUP_CONCAT(CONCAT(%s, \' : \ ', %s) SEPARATOR \' , \' ) ' , ['type ' , 'value ' ])
83+ new Sql \Expression (" GROUP_CONCAT(CONCAT(%s, ': ', %s) SEPARATOR ',') " , ['type ' , 'value ' ])
8484 ]);
8585 }
8686
@@ -101,12 +101,12 @@ public function fetchData()
101101 $ target ->host_port
102102 );
103103
104- unset($ target ->ip ); // Isn't needed any more!!
105- unset($ target ->chain ); // We don't need any relation properties anymore
104+ // Target ip is now obsolete and must not be included in the results.
105+ // The relation is only used to utilize the query and must not be in the result set as well.
106+ unset($ target ->ip );
107+ unset($ target ->chain );
106108
107- $ properties = iterator_to_array ($ target );
108-
109- $ results [$ target ->host_name_ip_and_port ] = (object ) $ properties ;
109+ $ results [$ target ->host_name_ip_and_port ] = (object ) iterator_to_array ($ target );
110110 }
111111
112112 return $ results ;
0 commit comments