From 28c024c0377af989d88754617bd40b961f28e250 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 21 Apr 2016 10:09:04 +0200 Subject: [PATCH] Repository: Properly handle non-aliased columns --- library/Icinga/Repository/Repository.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/library/Icinga/Repository/Repository.php b/library/Icinga/Repository/Repository.php index 581130ef9..df6a8934c 100644 --- a/library/Icinga/Repository/Repository.php +++ b/library/Icinga/Repository/Repository.php @@ -903,8 +903,9 @@ abstract class Repository implements Selectable $blacklist = $this->getBlacklistedQueryColumns(); $columns = array(); foreach ($queryColumns[$table] as $alias => $column) { - if (! in_array(is_string($alias) ? $alias : $column, $blacklist)) { - $columns[$alias] = $this->resolveQueryColumnAlias($table, $alias); + $name = is_string($alias) ? $alias : $column; + if (! in_array($name, $blacklist)) { + $columns[$alias] = $this->resolveQueryColumnAlias($table, $name); } }