summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/function.parse_service.php7
-rw-r--r--plugins/modifier.contact_info.php4
2 files changed, 6 insertions, 5 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));
diff --git a/plugins/modifier.contact_info.php b/plugins/modifier.contact_info.php
index 89b16a4..6537b7a 100644
--- a/plugins/modifier.contact_info.php
+++ b/plugins/modifier.contact_info.php
@@ -2,8 +2,8 @@
function smarty_modifier_contact_info($value)
{
- if (preg_match('/^([^:]*): (.*@.*)$/', $value, $match)) {
- return '[[' . $match[2] . '|' . $match[1] . ']]';
+ if (is_array($value)) {
+ return '[[' . array_values($value)[0] . '|' . array_keys($value)[0] . ']]';
}
return '[[' . $value . '@spline.inf.fu-berlin.de' . '|' . $value . ']]';