From 7916e0c0c6235f98d4cd75a7438239372c19e2da Mon Sep 17 00:00:00 2001 From: Markus Frosch Date: Fri, 14 Oct 2016 11:32:55 +0200 Subject: [PATCH] CustomVariable: Fix getType to output a useable value --- library/Director/CustomVariable/CustomVariable.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/library/Director/CustomVariable/CustomVariable.php b/library/Director/CustomVariable/CustomVariable.php index 4ecfb1c7..73f26998 100644 --- a/library/Director/CustomVariable/CustomVariable.php +++ b/library/Director/CustomVariable/CustomVariable.php @@ -40,8 +40,9 @@ abstract class CustomVariable implements IcingaConfigRenderer { if ($this->type === null) { $parts = explode('\\', get_class($this)); - // strlen('CustomVariable') === 9 - $this->type = substr(end($parts), 9); + $class = end($parts); + // strlen('CustomVariable') === 14 + $this->type = substr($class, 14); } return $this->type;