Allow passing customvar names in upper and lower case

Fix that customvar names are not properly lowercased in all places.

refs #10172
This commit is contained in:
Matthias Jentsch 2015-09-28 16:01:13 +02:00
parent ff5696e7a6
commit feaa92c491
3 changed files with 3 additions and 3 deletions

View File

@ -832,7 +832,7 @@ abstract class IdoQuery extends DbQuery
list($type, $name) = $this->customvarNameToTypeName($customvar);
$alias = ($type === 'host' ? 'hcv_' : 'scv_') . $name;
$this->customVars[$customvar] = $alias;
$this->customVars[strtolower($customvar)] = $alias;
if ($this->hasJoinedVirtualTable('services')) {
$leftcol = 's.' . $type . '_object_id';

View File

@ -82,7 +82,7 @@ class Controller extends IcingaWebController
'service_description',
'servicegroup_name',
function ($c) {
return preg_match('/^_(?:host|service)_/', $c);
return preg_match('/^_(?:host|service)_/i', $c);
}
));
foreach ($this->getRestrictions($name) as $filter) {

View File

@ -186,7 +186,7 @@ abstract class DataView implements QueryInterface, SortRules, FilterColumns, Ite
public function isValidFilterTarget($column)
{
// Customvar
if ($column[0] === '_' && preg_match('/^_(?:host|service)_/', $column)) {
if ($column[0] === '_' && preg_match('/^_(?:host|service)_/i', $column)) {
return true;
}
return in_array($column, $this->getColumns()) || in_array($column, $this->getStaticFilterColumns());