summaryrefslogtreecommitdiffstats
path: root/plugins/function.parse_service.php
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/function.parse_service.php')
-rw-r--r--plugins/function.parse_service.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/function.parse_service.php b/plugins/function.parse_service.php
index 1b02886..aa9983d 100644
--- a/plugins/function.parse_service.php
+++ b/plugins/function.parse_service.php
@@ -14,9 +14,10 @@ function smarty_function_parse_service($params, Smarty_Internal_Template $templa
$name = $params['value'];
$port = null;
- if (preg_match('/(.*): (.*)/', $params['value'], $match)) {
- $name = $match[1];
- $port = $match[2];
+
+ if (is_array($params['value'])) {
+ $name = array_keys($params['value'])[0];
+ $port = array_values($params['value'])[0];
}
$template->assign($params['var'], array('name' => $name, 'port' => $port));