Skip to content

Commit

Permalink
Allow passing customvar names in upper and lower case
Browse files Browse the repository at this point in the history
Fix that customvar names are not properly lowercased in all places.

refs #10172
  • Loading branch information
majentsch committed Sep 28, 2015
1 parent ff5696e commit feaa92c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ protected function joinCustomvar($customvar)
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';
Expand Down
2 changes: 1 addition & 1 deletion modules/monitoring/library/Monitoring/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ protected function getRestriction($name)
'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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public static function fromParams(array $params, array $columns = null)
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());
Expand Down

0 comments on commit feaa92c

Please sign in to comment.