[icinga-checkins] icinga.org: icingaweb2-module-director/master: CustomVariable: Fix getType to output a useable value

git at icinga.org git at icinga.org
Thu Nov 3 14:23:23 CET 2016


Module: icingaweb2-module-director
Branch: master
Commit: 7916e0c0c6235f98d4cd75a7438239372c19e2da
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=7916e0c0c6235f98d4cd75a7438239372c19e2da

Author: Markus Frosch <markus.frosch at icinga.com>
Date:   Fri Oct 14 11:32:55 2016 +0200

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 4ecfb1c..73f2699 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;



More information about the icinga-checkins mailing list