[icinga-checkins] icinga.org: icinga-web/master: Array test for exclude cf's (fixes #3279)

git at icinga.org git at icinga.org
Thu Oct 11 15:23:02 CEST 2012


Module: icinga-web
Branch: master
Commit: cff90d171180ac0f8b1de1abd30ed2df05158efa
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=cff90d171180ac0f8b1de1abd30ed2df05158efa

Author: Marius Hein <marius.hein at netways.de>
Date:   Thu Oct 11 15:22:37 2012 +0200

Array test for exclude cf's (fixes #3279)

---

 .../Api/models/Result/OutputRewriteModel.class.php |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/app/modules/Api/models/Result/OutputRewriteModel.class.php b/app/modules/Api/models/Result/OutputRewriteModel.class.php
index 836d8aa..4ef43af 100755
--- a/app/modules/Api/models/Result/OutputRewriteModel.class.php
+++ b/app/modules/Api/models/Result/OutputRewriteModel.class.php
@@ -141,12 +141,18 @@ class Api_Result_OutputRewriteModel extends IcingaApiBaseModel {
     /**
      * Exclude customvariables defined in api.exclude_customvars  (see #3183)
      * 
-     * @param type $val
-     * @param type $field
-     * @param type $row
+     * @param mixed $val
+     * @param string $field
+     * @param array $row
      */
     private function rewriteCustomvariables($val,$field,$row) {
         $namefield = str_replace("VALUE","NAME",$field);
+        
+        // If no excludes given (fixes #3279)
+        if (!is_array($this->excludeCVs)) {
+            return $val;
+        }
+        
         if(!isset($row[$namefield])) { // Fallback case: No name given, no c
             return "";
         } else if(in_array($row[$namefield],$this->excludeCVs)) {





More information about the icinga-checkins mailing list