[icinga-checkins] icinga.org: icingaweb2/master: Dashboard: fix complex urls

git at icinga.org git at icinga.org
Wed Nov 19 16:45:20 CET 2014


Module: icingaweb2
Branch: master
Commit: fa4419794732bd634bb0e8e058450bb1637c396d
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=fa4419794732bd634bb0e8e058450bb1637c396d

Author: Thomas Gelf <thomas at gelf.net>
Date:   Wed Nov 19 16:44:45 2014 +0100

Dashboard: fix complex urls

---

 library/Icinga/File/Ini/IniEditor.php             |    2 +-
 library/Icinga/Web/Widget/Dashboard/Component.php |    5 +----
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/library/Icinga/File/Ini/IniEditor.php b/library/Icinga/File/Ini/IniEditor.php
index e1a7984..ebac0ce 100644
--- a/library/Icinga/File/Ini/IniEditor.php
+++ b/library/Icinga/File/Ini/IniEditor.php
@@ -493,7 +493,7 @@ class IniEditor
     private function isPropertyDeclaration($lineContent, array $key)
     {
         return preg_match(
-            '/^\s*' . $this->formatKey($key) . '\s*=\s*/',
+            '/^\s*' . preg_quote($this->formatKey($key)) . '\s*=\s*/',
             $lineContent
         ) === 1;
     }
diff --git a/library/Icinga/Web/Widget/Dashboard/Component.php b/library/Icinga/Web/Widget/Dashboard/Component.php
index 1ab0ff6..955c1a4 100644
--- a/library/Icinga/Web/Widget/Dashboard/Component.php
+++ b/library/Icinga/Web/Widget/Dashboard/Component.php
@@ -156,15 +156,12 @@ EOD;
     public function toArray()
     {
         $array = array(
-            'url'   => $this->url->getPath(),
+            'url'   => $this->url->getRelativeUrl(),
             'title' => $this->getTitle()
         );
         if ($this->getDisabled() === true) {
             $array['disabled'] = 1;
         }
-        foreach ($this->url->getParams()->toArray() as $param) {
-            $array[$param[0]] = $param[1];
-        }
         return $array;
     }
 



More information about the icinga-checkins mailing list