From 75fb18bcec8650a80af5f5fd2f8ffa8a170babfa Mon Sep 17 00:00:00 2001 From: "Florian Aders (EleRas)" Date: Thu, 5 Feb 2015 20:07:22 +0100 Subject: [PATCH] Trim the values of the distribution - xml at sane places Signed-off-by: Florian Aders (EleRas) --- lib/classes/config/class.ConfigDaemon.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/classes/config/class.ConfigDaemon.php b/lib/classes/config/class.ConfigDaemon.php index 0e2bca02..b2bb4bc2 100644 --- a/lib/classes/config/class.ConfigDaemon.php +++ b/lib/classes/config/class.ConfigDaemon.php @@ -177,7 +177,7 @@ class ConfigDaemon { private function _parseInstall($order, $attributes) { // No sub - elements, so the content can be returned directly if ($order->count() == 0) { - return array('type' => 'install', 'content' => $this->_parseContent((string)$order)); + return array('type' => 'install', 'content' => $this->_parseContent(trim((string)$order))); } // Hold the results @@ -186,7 +186,7 @@ class ConfigDaemon { foreach($order->children() as $child) { switch((string)$child->getName()) { case "visibility": $visibility += $this->_checkVisibility($child); break; - case "content": $content = (string)$child; break; + case "content": $content = trim((string)$child); break; } } @@ -206,7 +206,7 @@ class ConfigDaemon { private function _parseCommand($order, $attributes) { // No sub - elements, so the content can be returned directly if ($order->count() == 0) { - return array('type' => 'command', 'content' => $this->_parseContent((string)$order)); + return array('type' => 'command', 'content' => $this->_parseContent(trim((string)$order))); } // Hold the results @@ -215,7 +215,7 @@ class ConfigDaemon { foreach($order->children() as $child) { switch((string)$child->getName()) { case "visibility": $visibility += $this->_checkVisibility($child); break; - case "content": $content = (string)$child; break; + case "content": $content = trim((string)$child); break; } } @@ -317,10 +317,10 @@ class ConfigDaemon { private function _checkVisibility($order) { $attributes = array(); foreach($order->attributes() as $key => $value) { - $attributes[(string)$key] = $this->_parseContent((string)$value); + $attributes[(string)$key] = $this->_parseContent(trim((string)$value)); } - $order = $this->_parseContent((string)$order); + $order = $this->_parseContent(trim((string)$order)); if (!array_key_exists('mode', $attributes)) { throw new \Exception('"' . $order . '" is missing mode'); }