summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alex@spline.inf.fu-berlin.de>2015-09-28 00:42:30 +0200
committerwww-data <www-data@vm-doku.spline.inf.fu-berlin.de>2015-09-28 00:42:30 +0200
commitec4c627649a0b31f804f9cbdbfc84d375b774cd2 (patch)
tree873a585ff9ad9ca41b9ffaf7b745ca8fb5acb1c8
parent4480a7e61e591bd7098e51cabbe38aa4f8cd72e8 (diff)
downloaddokuwiki-ec4c627649a0b31f804f9cbdbfc84d375b774cd2.tar.gz
dokuwiki-ec4c627649a0b31f804f9cbdbfc84d375b774cd2.tar.bz2
dokuwiki-ec4c627649a0b31f804f9cbdbfc84d375b774cd2.zip
The new symfony-yaml version can parse extended mappings
-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 . ']]';